summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-09-07 17:00:02 +0100
committerRichard van der Hoff <richard@matrix.org>2020-09-07 17:00:02 +0100
commit5c4b13cd8fed6cb11bba5e8a5a8be293f4af7fb5 (patch)
tree97cc9f314478d6c40b3e1ea06978d151e4f6dfbb /synapse/push
parentMerge branch 'release-v1.20.0' into matrix-org-hotfixes (diff)
parentOnly add rows to the push actions table if the event notifies or should be ma... (diff)
downloadsynapse-5c4b13cd8fed6cb11bba5e8a5a8be293f4af7fb5.tar.xz
Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index 1bb8e346b9..c440f2545c 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -219,7 +219,12 @@ class BulkPushRuleEvaluator:
                 if event.type == EventTypes.Member and event.state_key == uid:
                     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:
                 if "enabled" in rule and not rule["enabled"]: