diff options
author | Patrick Cloke <patrickc@matrix.org> | 2020-12-02 08:40:21 -0500 |
---|---|---|
committer | Patrick Cloke <patrickc@matrix.org> | 2020-12-02 08:40:21 -0500 |
commit | 16744644f665991eb7b6a41e8c16e71ccdb71709 (patch) | |
tree | 8c607ab32dc9881a2c7c71e5632b71557e1999e1 /synapse/push/httppusher.py | |
parent | Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff) | |
parent | Fix a regression when grandfathering SAML users. (#8855) (diff) | |
download | synapse-16744644f665991eb7b6a41e8c16e71ccdb71709.tar.xz |
Merge branch 'release-v1.24.0' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/push/httppusher.py')
-rw-r--r-- | synapse/push/httppusher.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index afdf0bf131..d011e0aced 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -75,6 +75,7 @@ class HttpPusher: self.failing_since = pusherdict["failing_since"] self.timed_call = None self._is_processing = False + self._group_unread_count_by_room = hs.config.push_group_unread_count_by_room # This is the highest stream ordering we know it's safe to process. # When new events arrive, we'll be given a window of new events: we @@ -140,7 +141,11 @@ class HttpPusher: async def _update_badge(self): # XXX as per https://github.com/matrix-org/matrix-doc/issues/2627, this seems # to be largely redundant. perhaps we can remove it. - badge = await push_tools.get_badge_count(self.hs.get_datastore(), self.user_id) + badge = await push_tools.get_badge_count( + self.hs.get_datastore(), + self.user_id, + group_by_room=self._group_unread_count_by_room, + ) await self._send_badge(badge) def on_timer(self): @@ -287,7 +292,11 @@ class HttpPusher: return True tweaks = push_rule_evaluator.tweaks_for_actions(push_action["actions"]) - badge = await push_tools.get_badge_count(self.hs.get_datastore(), self.user_id) + badge = await push_tools.get_badge_count( + self.hs.get_datastore(), + self.user_id, + group_by_room=self._group_unread_count_by_room, + ) event = await self.store.get_event(push_action["event_id"], allow_none=True) if event is None: |