summary refs log tree commit diff
path: root/synapse/push/push_tools.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-08-03 16:22:42 -0700
committerAndrew Morgan <andrew@amorgan.xyz>2020-08-03 16:22:42 -0700
commite64449b7bee96703233235d70961482e860aace9 (patch)
treee73a7481fccd2b2e4c912c94f56163b39cc81d9d /synapse/push/push_tools.py
parentMerge commit 'e452973fd' into dinsic (diff)
parentImplement unread counter (MSC2625) (#7673) (diff)
downloadsynapse-e64449b7bee96703233235d70961482e860aace9.tar.xz
Merge commit '46613aaf7' into dinsic
* commit '46613aaf7': (27 commits)
  Incorporate review
  Lint
  Incorporate review bits
  Pre-populate the unread_count column
  Don't update the schema version
  Use attr instead of a dict
  Lint
  Test that a mark_unread action updates the right counter when using a slave store
  Remove debug logging
  Test that a mark_unread action updates the right counter
  Fix summary rotation
  Log for invalid values of notif
  Fix SQL
  Fix schema update
  Lint
  Save the count of unread messages to event_push_summary
  Actually act on mark_unread
  Appease mypy
  Lint
  Use temporary prefixes as per the MSC
  ...
Diffstat (limited to 'synapse/push/push_tools.py')
-rw-r--r--synapse/push/push_tools.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/push/push_tools.py b/synapse/push/push_tools.py

index 5dae4648c0..9f264ca4a4 100644 --- a/synapse/push/push_tools.py +++ b/synapse/push/push_tools.py
@@ -39,7 +39,10 @@ def get_badge_count(store, user_id): ) # return one badge count per conversation, as count per # message is so noisy as to be almost useless - badge += 1 if notifs["notify_count"] else 0 + # We're populating this badge using the unread_count (instead of the + # notify_count) as this badge is the number of missed messages, not the + # number of missed notifications. + badge += 1 if notifs["unread_count"] else 0 return badge