summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-01-07 13:04:45 +0000
committerErik Johnston <erik@matrix.org>2021-01-07 13:04:45 +0000
commit82a91208d6a9fd3038e1ec4ddcc62cbe359f2a6b (patch)
tree4bc3e65a85fd5ea886128e0a5a96e0ce8872a8bb /synapse/push
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentImprove the performance of calculating ignored users in large rooms (#9024) (diff)
downloadsynapse-82a91208d6a9fd3038e1ec4ddcc62cbe359f2a6b.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py

index 10f27e4378..9018f9e20b 100644 --- a/synapse/push/bulk_push_rule_evaluator.py +++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -203,14 +203,18 @@ class BulkPushRuleEvaluator: condition_cache = {} # type: Dict[str, bool] + # If the event is not a state event check if any users ignore the sender. + if not event.is_state(): + ignorers = await self.store.ignored_by(event.sender) + else: + ignorers = set() + for uid, rules in rules_by_user.items(): if event.sender == uid: continue - if not event.is_state(): - is_ignored = await self.store.is_ignored_by(event.sender, uid) - if is_ignored: - continue + if uid in ignorers: + continue display_name = None profile_info = room_members.get(uid)