From f1b67730fa085755a7ab459b0239608bd3585a67 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 4 Jan 2016 14:50:36 +0000 Subject: [PATCH] Add unread_notif_count in incremental_sync_with_gap --- synapse/handlers/sync.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 64556c5eb..93c48d167 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -749,6 +749,13 @@ class SyncHandler(BaseHandler): if just_joined: state = yield self.get_state_at(room_id, now_token) + notifs = yield self.unread_notifs_for_room_id( + room_id, sync_config, ephemeral_by_room + ) + notif_count = None + if notifs is not None: + notif_count = len(notifs) + room_sync = JoinedSyncResult( room_id=room_id, timeline=batch, @@ -757,6 +764,7 @@ class SyncHandler(BaseHandler): account_data=self.account_data_for_room( room_id, tags_by_room, account_data_by_room ), + unread_notification_count=notif_count, ) logging.debug("Room sync: %r", room_sync)