mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 23:30:28 +03:00
Fix unable to mark as read some rooms
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
ca55141276
commit
27d0a88b36
3 changed files with 13 additions and 17 deletions
|
|
@ -81,6 +81,13 @@ class Notifications extends EventEmitter {
|
|||
return this.roomIdToNoti.has(roomId);
|
||||
}
|
||||
|
||||
deleteNoti(roomId) {
|
||||
if (this.hasNoti(roomId)) {
|
||||
const noti = this.getNoti(roomId);
|
||||
this._deleteNoti(roomId, noti.total, noti.highlight);
|
||||
}
|
||||
}
|
||||
|
||||
_getAllParentIds(roomId) {
|
||||
let allParentIds = this.roomList.roomIdToParents.get(roomId);
|
||||
if (allParentIds === undefined) return new Set();
|
||||
|
|
@ -174,17 +181,13 @@ class Notifications extends EventEmitter {
|
|||
const readerUserId = Object.keys(content[readedEventId]['m.read'])[0];
|
||||
if (readerUserId !== this.matrixClient.getUserId()) return;
|
||||
|
||||
if (this.hasNoti(room.roomId)) {
|
||||
const noti = this.getNoti(room.roomId);
|
||||
this._deleteNoti(room.roomId, noti.total, noti.highlight);
|
||||
}
|
||||
this.deleteNoti(room.roomId);
|
||||
}
|
||||
});
|
||||
|
||||
this.matrixClient.on('Room.myMembership', (room, membership) => {
|
||||
if (membership === 'leave' && this.hasNoti(room.roomId)) {
|
||||
const noti = this.getNoti(room.roomId);
|
||||
this._deleteNoti(room.roomId, noti.total, noti.highlight);
|
||||
this.deleteNoti(room.roomId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue