Fix muted room notification visible in space

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2022-03-15 13:41:52 +05:30
parent 5be4287230
commit 23f57e4d75

View file

@ -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') {