From 23f57e4d75172e6ba7e01a2c0fc143c78b2c0ca6 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Tue, 15 Mar 2022 13:41:52 +0530 Subject: [PATCH] Fix muted room notification visible in space Signed-off-by: Ajay Bura --- src/client/state/Notifications.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/state/Notifications.js b/src/client/state/Notifications.js index bf45f576..23abe6dc 100644 --- a/src/client/state/Notifications.js +++ b/src/client/state/Notifications.js @@ -215,6 +215,7 @@ class Notifications extends EventEmitter { this.matrixClient.on('Room.timeline', (mEvent, room) => { if (room.isSpaceRoom()) return; if (!isNotifEvent(mEvent)) return; + const liveEvents = room.getLiveTimeline().getEvents(); const lastTimelineEvent = liveEvents[liveEvents.length - 1]; @@ -224,6 +225,11 @@ class Notifications extends EventEmitter { const total = room.getUnreadNotificationCount('total'); const highlight = room.getUnreadNotificationCount('highlight'); + if (this.getNotiType(room.roomId) === cons.notifs.MUTE) { + this.deleteNoti(room.roomId, total ?? 0, highlight ?? 0); + return; + } + this._setNoti(room.roomId, total ?? 0, highlight ?? 0); if (this.matrixClient.getSyncState() === 'SYNCING') {