mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 15:08:49 +03:00
SS: Hook up notification counts
This commit is contained in:
parent
44ac2aa3b6
commit
98b3f56411
1 changed files with 8 additions and 5 deletions
|
@ -2364,6 +2364,11 @@ class SlidingSyncHandler:
|
||||||
|
|
||||||
set_tag(SynapseTags.RESULT_PREFIX + "initial", initial)
|
set_tag(SynapseTags.RESULT_PREFIX + "initial", initial)
|
||||||
|
|
||||||
|
notif_counts = await self.store.get_unread_event_push_actions_by_room_for_user(
|
||||||
|
room_id,
|
||||||
|
sync_config.user.to_string(),
|
||||||
|
)
|
||||||
|
|
||||||
return SlidingSyncResult.RoomResult(
|
return SlidingSyncResult.RoomResult(
|
||||||
name=room_name,
|
name=room_name,
|
||||||
avatar=room_avatar,
|
avatar=room_avatar,
|
||||||
|
@ -2384,11 +2389,9 @@ class SlidingSyncHandler:
|
||||||
invited_count=room_membership_summary.get(
|
invited_count=room_membership_summary.get(
|
||||||
Membership.INVITE, empty_membership_summary
|
Membership.INVITE, empty_membership_summary
|
||||||
).count,
|
).count,
|
||||||
# TODO: These are just dummy values. We could potentially just remove these
|
# TODO: What about notifications in threads?
|
||||||
# since notifications can only really be done correctly on the client anyway
|
notification_count=notif_counts.main_timeline.notify_count,
|
||||||
# (encrypted rooms).
|
highlight_count=notif_counts.main_timeline.highlight_count,
|
||||||
notification_count=0,
|
|
||||||
highlight_count=0,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@trace
|
@trace
|
||||||
|
|
Loading…
Reference in a new issue