summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-01 11:34:06 +0100
committerErik Johnston <erik@matrix.org>2016-06-03 11:04:31 +0100
commit9c26b390a2112590fe4252057dc1f081cb99a6b1 (patch)
tree4328f6b2656830853706d91f1ca992cc506bdc65 /synapse/push
parentMerge pull request #811 from matrix-org/erikj/state_users_in_room (diff)
downloadsynapse-9c26b390a2112590fe4252057dc1f081cb99a6b1.tar.xz
Only get local users
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index 8c59e59e03..d50db3b736 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -83,10 +83,13 @@ def evaluator_for_event(event, hs, store, current_state):
         e.state_key for e in current_state.values()
         if e.type == EventTypes.Member and e.membership == Membership.JOIN
     )
+    local_users_in_room = set(uid for uid in all_in_room if hs.is_mine_id(uid))
 
     # users in the room who have pushers need to get push rules run because
     # that's how their pushers work
-    if_users_with_pushers = yield store.get_if_users_have_pushers(all_in_room)
+    if_users_with_pushers = yield store.get_if_users_have_pushers(
+        local_users_in_room
+    )
     users_with_pushers = set(
         uid for uid, have_pusher in if_users_with_pushers.items() if have_pusher
     )
@@ -96,7 +99,7 @@ def evaluator_for_event(event, hs, store, current_state):
     # any users with pushers must be ours: they have pushers
     user_ids = set(users_with_pushers)
     for uid in users_with_receipts:
-        if hs.is_mine_id(uid) and uid in all_in_room:
+        if uid in local_users_in_room:
             user_ids.add(uid)
 
     # if this event is an invite event, we may need to run rules for the user