Use ignoreSelfEvent

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-08-11 17:54:27 +02:00
parent ee0eda7947
commit 1f98ea4562
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

@ -87,7 +87,10 @@ export const sortRooms = (rooms: Room[]): Room[] => {
const ev = r.timeline[i]; const ev = r.timeline[i];
if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?) if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?)
if (ev.getSender() === myUserId || Unread.eventTriggersUnreadCount(ev)) { if (
(ev.getSender() === myUserId && !ignoreSelfEvent(ev)) ||
Unread.eventTriggersUnreadCount(ev)
) {
return ev.getTs(); return ev.getTs();
} }
} }