Speed up event filtering (for ACL) logic

This commit is contained in:
Erik Johnston 2015-08-04 09:32:23 +01:00
parent 2c963054f8
commit 4d6cb8814e
5 changed files with 105 additions and 46 deletions

View file

@ -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)