summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-01-04 14:50:36 +0000
committerDavid Baker <dave@matrix.org>2016-01-04 14:50:36 +0000
commitf1b67730fa085755a7ab459b0239608bd3585a67 (patch)
tree388bfde2a3f0a8a500102ff18c93de0bed13ebc1
parentfix tests (diff)
downloadsynapse-f1b67730fa085755a7ab459b0239608bd3585a67.tar.xz
Add unread_notif_count in incremental_sync_with_gap
-rw-r--r--synapse/handlers/sync.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 64556c5eb8..93c48d167a 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)