From b52926f7d874a408fc444056f3c48903738c69f4 Mon Sep 17 00:00:00 2001 From: litruv Date: Fri, 24 Jul 2026 00:29:24 +1000 Subject: [PATCH] Fix system notifications ignoring mention-only and default room settings. Skip non-highlight events for Mentions/Default non-DM rooms so public chats stay quiet unless they should ping. --- .../features/background-notifications/HANDOFF.md | 2 ++ src/app/pages/client/ClientNonUIFeatures.tsx | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/handoff/features/background-notifications/HANDOFF.md b/docs/handoff/features/background-notifications/HANDOFF.md index 9dd5587..8b12c65 100644 --- a/docs/handoff/features/background-notifications/HANDOFF.md +++ b/docs/handoff/features/background-notifications/HANDOFF.md @@ -76,6 +76,7 @@ tauri.ts / electron main - Multiple runtimes: `isTauri`, `isElectron`, `isCapacitorNative` branch logic - Pusher registration races on fast login/logout - Android small icon: `ic_stat_paarrot` must exist in Android resources +- Background wake (`MatrixSyncService`) must filter by push rules / unread_notifications; a push for one room used to notify for every new message in the sync batch ## Future work @@ -91,3 +92,4 @@ tauri.ts / electron main - Constants: `PUSHER_APP_ID_BASE`, `PUSHER_STORAGE_PREFIX` in `backgroundSync.ts` - Logo assets: `paarrot.svg`, `paarrot-unread.svg`, `paarrot-highlight.svg` in `public/res/svg/` +- Android notify filter: mute / mentions / default-room behavior lives in `MatrixSyncService.resolveRoomNotifyMode` diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 1387ffa..d8ef800 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -378,6 +378,14 @@ function MessageNotifications() { return; } + // Match TitleBar / room bell settings: Default and Mentions rooms only notify on highlights. + const notificationType = getNotificationType(mx, room.roomId); + const isDm = mDirects.has(room.roomId); + const mentionsOnly = + notificationType === NotificationType.MentionsAndKeywords || + (notificationType === NotificationType.Default && !isDm); + if (mentionsOnly && unreadInfo.highlight === 0) return; + if ( showNotifications && ((isTauri() && !isElectron()) || isCapacitorNative() || notificationPermission('granted')) @@ -399,7 +407,6 @@ function MessageNotifications() { messageBody = typeof content.body === 'string' ? content.body : undefined; } - const isDm = room.getJoinedMemberCount() === 2 && !room.isSpaceRoom(); notify({ roomName: room.name ?? 'Unknown', roomAvatar: avatarMxc @@ -430,6 +437,7 @@ function MessageNotifications() { notify, selectedRoomId, useAuthentication, + mDirects, ]); return null;