Skip to content
Snippets Groups Projects
Unverified Commit e35d44c0 authored by Brendan Abolivier's avatar Brendan Abolivier Committed by GitHub
Browse files

Merge pull request #7716 from matrix-org/babolivier/unread_fix

Fix unread counts in sync
parents 36308256 5a5cf646
No related branches found
No related tags found
No related merge requests found
Add a per-room counter for unread messages in responses to `/sync` requests. Implements [MSC2625](https://github.com/matrix-org/matrix-doc/pull/2625).
......@@ -42,7 +42,7 @@ def get_badge_count(store, user_id):
# 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
badge += 1 if notifs.get("unread_count") else 0
return badge
......
......@@ -123,7 +123,7 @@ class EventPushActionsWorkerStore(SQLBaseStore):
txn.execute(sql, (room_id, last_read_event_id))
results = txn.fetchall()
if len(results) == 0:
return {"notify_count": 0, "highlight_count": 0}
return {"notify_count": 0, "highlight_count": 0, "unread_count": 0}
stream_ordering = results[0][0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment