summary refs log tree commit diff
diff options
context:
space:
mode:
authorH. Shay <hillerys@element.io>2022-10-06 12:09:53 -0700
committerH. Shay <hillerys@element.io>2022-10-06 12:09:53 -0700
commitece0f566e8f78d72df5915e9ba0e19940409161d (patch)
treeb6f15a752b25cfbfca397e2924a14625c1621186
parentMerge branch 'develop' into shay/more_batching (diff)
downloadsynapse-ece0f566e8f78d72df5915e9ba0e19940409161d.tar.xz
fix merge conflict
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py33
1 files changed, 8 insertions, 25 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index 117c77fdda..2ecfdf2951 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -304,30 +304,6 @@ class BulkPushRuleEvaluator:
                 event, context, event_id_to_event
             )
 
-            # Recursively attempt to find the thread this event relates to.
-            if relation.rel_type == RelationTypes.THREAD:
-                thread_id = relation.parent_id
-            else:
-                # Since the event has not yet been persisted we check whether
-                # the parent is part of a thread.
-                thread_id = await self.store.get_thread_id(relation.parent_id) or "main"
-
-        # It's possible that old room versions have non-integer power levels (floats or
-        # strings). Workaround this by explicitly converting to int.
-        notification_levels = power_levels.get("notifications", {})
-        if not event.room_version.msc3667_int_only_power_levels:
-            for user_id, level in notification_levels.items():
-                notification_levels[user_id] = int(level)
-
-        evaluator = PushRuleEvaluator(
-            _flatten_dict(event),
-            room_member_count,
-            sender_power_level,
-            notification_levels,
-            relations,
-            self._relations_match_enabled,
-        )
-
             relation = relation_from_event(event)
             # If the event does not have a relation, then cannot have any mutual
             # relations or thread ID.
@@ -348,11 +324,18 @@ class BulkPushRuleEvaluator:
                         await self.store.get_thread_id(relation.parent_id) or "main"
                     )
 
+            # It's possible that old room versions have non-integer power levels (floats or
+            # strings). Workaround this by explicitly converting to int.
+            notification_levels = power_levels.get("notifications", {})
+            if not event.room_version.msc3667_int_only_power_levels:
+                for user_id, level in notification_levels.items():
+                    notification_levels[user_id] = int(level)
+
             evaluator = PushRuleEvaluator(
                 _flatten_dict(event),
                 room_member_count,
                 sender_power_level,
-                power_levels.get("notifications", {}),
+                notification_levels,
                 relations,
                 self._relations_match_enabled,
             )