summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-04 09:32:23 +0100
committerErik Johnston <erik@matrix.org>2015-08-04 09:32:23 +0100
commit4d6cb8814e134eba644afeed7bd49df0c7951342 (patch)
treef6d14b56fd5ec6691eb95f0c160b632b64dd192c /synapse/handlers/sync.py
parentMerge pull request #210 from matrix-org/reg-v2a-password-skip (diff)
downloadsynapse-4d6cb8814e134eba644afeed7bd49df0c7951342.tar.xz
Speed up event filtering (for ACL) logic
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 6cff6230c1..8f58774b31 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -295,7 +295,11 @@ class SyncHandler(BaseHandler):
     @defer.inlineCallbacks
     def _filter_events_for_client(self, user_id, room_id, events):
         states = yield self.store.get_state_for_events(
-            room_id, [e.event_id for e in events],
+            room_id, frozenset(e.event_id for e in events),
+            types=(
+                (EventTypes.RoomHistoryVisibility, ""),
+                (EventTypes.Member, user_id),
+            )
         )
 
         events_and_states = zip(events, states)