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

Only add rows to the push actions table if the event notifies or should be marked unread (#8274)

parent ef2804d2
No related branches found
No related tags found
No related merge requests found
Add unread messages count to sync responses, as specified in [MSC2654](https://github.com/matrix-org/matrix-doc/pull/2654).
...@@ -219,7 +219,12 @@ class BulkPushRuleEvaluator: ...@@ -219,7 +219,12 @@ class BulkPushRuleEvaluator:
if event.type == EventTypes.Member and event.state_key == uid: if event.type == EventTypes.Member and event.state_key == uid:
display_name = event.content.get("displayname", None) display_name = event.content.get("displayname", None)
actions_by_user[uid] = [] if count_as_unread:
# Add an element for the current user if the event needs to be marked as
# unread, so that add_push_actions_to_staging iterates over it.
# If the event shouldn't be marked as unread but should notify the
# current user, it'll be added to the dict later.
actions_by_user[uid] = []
for rule in rules: for rule in rules:
if "enabled" in rule and not rule["enabled"]: if "enabled" in rule and not rule["enabled"]:
......
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