1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Do not assume unread state if read receipt comes from a thread (#7368)

This commit is contained in:
Germain
2021-12-17 07:32:10 +00:00
committed by GitHub
parent d009cebb07
commit feea80dfd5

View File

@@ -67,6 +67,15 @@ export function doesRoomHaveUnreadMessages(room: Room): boolean {
return false; 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 // 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 // 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 // don't count, we don't know if there are any events that do count between where