summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-01 15:45:37 +0100
committerErik Johnston <erik@matrix.org>2016-06-03 11:05:45 +0100
commit59f2d7352224af97e8f091f673858dde42b00197 (patch)
treeffa3598fd9f5f6d6991a5f760f1b84329caff19c
parentOnly get local users (diff)
downloadsynapse-59f2d7352224af97e8f091f673858dde42b00197.tar.xz
Remove unnecessary sets
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index d50db3b736..af5212a5d1 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -79,25 +79,24 @@ def evaluator_for_event(event, hs, store, current_state):
     # generating them for bot / AS users etc, we only do so for people who've
     # sent a read receipt into the room.
 
-    all_in_room = set(
+    local_users_in_room = set(
         e.state_key for e in current_state.values()
         if e.type == EventTypes.Member and e.membership == Membership.JOIN
+        and hs.is_mine_id(e.state_key)
     )
-    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(
         local_users_in_room
     )
-    users_with_pushers = set(
+    user_ids = set(
         uid for uid, have_pusher in if_users_with_pushers.items() if have_pusher
     )
 
     users_with_receipts = yield store.get_users_with_read_receipts_in_room(room_id)
 
     # any users with pushers must be ours: they have pushers
-    user_ids = set(users_with_pushers)
     for uid in users_with_receipts:
         if uid in local_users_in_room:
             user_ids.add(uid)
@@ -111,8 +110,6 @@ def evaluator_for_event(event, hs, store, current_state):
             if has_pusher:
                 user_ids.add(invited_user)
 
-    user_ids = list(user_ids)
-
     rules_by_user = yield _get_rules(room_id, user_ids, store)
 
     defer.returnValue(BulkPushRuleEvaluator(