mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-09 13:41:55 +00:00
Unread counts fixes (#8254)
* Fixup `ALTER TABLE` database queries Make the new columns nullable, because doing otherwise can wedge a server with a big database, as setting a default value rewrites the table. * Switch back to using the notifications count in the push badge Clients are likely to be confused if we send a push but the badge count is the unread messages one, and not the notifications one. * Changelog
This commit is contained in:
parent
db7de4d182
commit
041ee971c9
1
changelog.d/8254.feature
Normal file
1
changelog.d/8254.feature
Normal file
@ -0,0 +1 @@
|
|||||||
|
Add unread messages count to sync responses, as specified in [MSC2654](https://github.com/matrix-org/matrix-doc/pull/2654).
|
@ -36,7 +36,7 @@ async def get_badge_count(store, user_id):
|
|||||||
)
|
)
|
||||||
# return one badge count per conversation, as count per
|
# return one badge count per conversation, as count per
|
||||||
# message is so noisy as to be almost useless
|
# message is so noisy as to be almost useless
|
||||||
badge += 1 if notifs["unread_count"] else 0
|
badge += 1 if notifs["notify_count"] else 0
|
||||||
return badge
|
return badge
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
-- Add columns to event_push_actions and event_push_actions_staging to track unread
|
-- Add columns to event_push_actions and event_push_actions_staging to track unread
|
||||||
-- messages and calculate unread counts.
|
-- messages and calculate unread counts.
|
||||||
ALTER TABLE event_push_actions_staging ADD COLUMN unread SMALLINT NOT NULL DEFAULT 0;
|
ALTER TABLE event_push_actions_staging ADD COLUMN unread SMALLINT;
|
||||||
ALTER TABLE event_push_actions ADD COLUMN unread SMALLINT NOT NULL DEFAULT 0;
|
ALTER TABLE event_push_actions ADD COLUMN unread SMALLINT;
|
||||||
|
|
||||||
-- Add column to event_push_summary
|
-- Add column to event_push_summary
|
||||||
ALTER TABLE event_push_summary ADD COLUMN unread_count BIGINT NOT NULL DEFAULT 0;
|
ALTER TABLE event_push_summary ADD COLUMN unread_count BIGINT;
|
Loading…
Reference in New Issue
Block a user