diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-04 09:32:23 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-04 09:32:23 +0100 |
commit | 4d6cb8814e134eba644afeed7bd49df0c7951342 (patch) | |
tree | f6d14b56fd5ec6691eb95f0c160b632b64dd192c /synapse/handlers/sync.py | |
parent | Merge pull request #210 from matrix-org/reg-v2a-password-skip (diff) | |
download | synapse-4d6cb8814e134eba644afeed7bd49df0c7951342.tar.xz |
Speed up event filtering (for ACL) logic
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r-- | synapse/handlers/sync.py | 6 |
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) |