Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Do not assume unread state if read receipt comes from a thread (#7368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Germain authored Dec 17, 2021
1 parent d009ceb commit feea80d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Unread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ export function doesRoomHaveUnreadMessages(room: Room): boolean {
return false;
}

// if the read receipt relates to an event is that part of a thread
// we consider that there are no unread messages
// This might be a false negative, but probably the best we can do until
// the read receipts have evolved to cater for threads
const event = room.findEventById(readUpToId);
if (event?.getThread()) {
return false;
}

// this just looks at whatever history we have, which if we've only just started
// up probably won't be very much, so if the last couple of events are ones that
// don't count, we don't know if there are any events that do count between where
Expand Down

0 comments on commit feea80d

Please sign in to comment.