Pass around MatrixClients instead of using MatrixClientPeg (#11000)

This commit is contained in:
Michael Telatynski
2023-05-30 10:36:34 +01:00
committed by GitHub
parent aa5a2e1363
commit 938aefc51c
28 changed files with 176 additions and 141 deletions
@@ -95,7 +95,10 @@ const getLastTs = (r: Room, userId: string): number => {
const ev = r.timeline[i];
if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?)
if ((ev.getSender() === userId && shouldCauseReorder(ev)) || Unread.eventTriggersUnreadCount(ev)) {
if (
(ev.getSender() === userId && shouldCauseReorder(ev)) ||
Unread.eventTriggersUnreadCount(r.client, ev)
) {
return ev.getTs();
}
}