Don't increment room unreads for our own events

This commit is contained in:
miruka 2020-04-16 13:17:17 -04:00
parent e98a539433
commit 568d4fddce

View File

@ -108,9 +108,10 @@ class NioCallbacks:
room, ev, content=co, mentions=mention_list, room, ev, content=co, mentions=mention_list,
) )
is_past = await self.client.event_is_past(ev) past = await self.client.event_is_past(ev)
from_us = ev.sender in self.client.backend.clients
if not is_past and self.client.open_room != room.room_id: if not past and not from_us and self.client.open_room != room.room_id:
model = self.client.models[self.client.user_id, "rooms"] model = self.client.models[self.client.user_id, "rooms"]
room = model[room.room_id] room = model[room.room_id]
room.unreads += 1 room.unreads += 1