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.
This commit is contained in:
2026-07-24 00:29:24 +10:00
parent d338e1c35e
commit b52926f7d8
2 changed files with 11 additions and 1 deletions

View File

@@ -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;