Add unread_notif_count in incremental_sync_with_gap

This commit is contained in:
David Baker 2016-01-04 14:50:36 +00:00
parent 92a1e74b20
commit f1b67730fa
1 changed files with 8 additions and 0 deletions

View File

@ -749,6 +749,13 @@ class SyncHandler(BaseHandler):
if just_joined: if just_joined:
state = yield self.get_state_at(room_id, now_token) 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_sync = JoinedSyncResult(
room_id=room_id, room_id=room_id,
timeline=batch, timeline=batch,
@ -757,6 +764,7 @@ class SyncHandler(BaseHandler):
account_data=self.account_data_for_room( account_data=self.account_data_for_room(
room_id, tags_by_room, account_data_by_room room_id, tags_by_room, account_data_by_room
), ),
unread_notification_count=notif_count,
) )
logging.debug("Room sync: %r", room_sync) logging.debug("Room sync: %r", room_sync)