Cross-client unread counters & send read receipts

This commit is contained in:
miruka
2020-06-01 09:25:09 -04:00
parent d2300bf663
commit f686b96511
5 changed files with 31 additions and 31 deletions

View File

@@ -70,13 +70,11 @@ class NioCallbacks:
# Response callbacks
async def onSyncResponse(self, resp: nio.SyncResponse) -> None:
room_model = self.models[self.user_id, "rooms"]
for room_id in resp.rooms.invite:
await self.client.register_nio_room(self.client.all_rooms[room_id])
for room_id, info in resp.rooms.join.items():
if room_id not in room_model:
# Just in case we don't get any events for that room that
# triggers other callbacks
await self.client.register_nio_room(self.client.rooms[room_id])
await self.client.register_nio_room(self.client.rooms[room_id])
if room_id not in self.client.past_tokens:
self.client.past_tokens[room_id] = info.timeline.prev_batch