summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-07-31 10:30:05 +0100
committerRichard van der Hoff <richard@matrix.org>2020-07-31 10:30:05 +0100
commit82fec809a5c8be0a19bf2ca14f66d8d041dafeda (patch)
tree44adeb288d4659413e626f50e46d716401298d2a /synapse/handlers/sync.py
parentMerge branch 'release-v1.18.0' into matrix-org-hotfixes (diff)
parentAdd docs for undoing room shutdowns (#7998) (diff)
downloadsynapse-82fec809a5c8be0a19bf2ca14f66d8d041dafeda.tar.xz
Merge branch 'develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py

index c308647700..67b9f9afbf 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py
@@ -104,6 +104,7 @@ class JoinedSyncResult: account_data = attr.ib(type=List[JsonDict]) unread_notifications = attr.ib(type=JsonDict) summary = attr.ib(type=Optional[JsonDict]) + unread_count = attr.ib(type=int) def __nonzero__(self) -> bool: """Make the result appear empty if there are no updates. This is used @@ -1889,6 +1890,10 @@ class SyncHandler(object): if room_builder.rtype == "joined": unread_notifications = {} # type: Dict[str, str] + + unread_count = await self.store.get_unread_message_count_for_user( + room_id, sync_config.user.to_string(), + ) room_sync = JoinedSyncResult( room_id=room_id, timeline=batch, @@ -1897,6 +1902,7 @@ class SyncHandler(object): account_data=account_data_events, unread_notifications=unread_notifications, summary=summary, + unread_count=unread_count, ) if room_sync or always_include: