diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-11 17:19:21 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-11 17:19:21 +0100 |
commit | 40affadaaa416aa341b84685df3f336d68467aff (patch) | |
tree | 617dd00c278830309034a84ec188ea8dc8077775 /synapse/handlers/federation.py | |
parent | Lower cache size (diff) | |
download | synapse-40affadaaa416aa341b84685df3f336d68467aff.tar.xz |
Fix ACL filtering github/erikj/acl_perf erikj/acl_perf
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 22f534e49a..17c063b55f 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -229,7 +229,7 @@ class FederationHandler(BaseHandler): @defer.inlineCallbacks def _filter_events_for_server(self, server_name, room_id, events): - states = yield self.store.get_state_for_events( + events_to_state = yield self.store.get_state_for_events( room_id, frozenset(e.event_id for e in events), types=( (EventTypes.RoomHistoryVisibility, ""), @@ -237,8 +237,6 @@ class FederationHandler(BaseHandler): ) ) - events_and_states = zip(events, states) - def redact_disallowed(event_and_state): event, state = event_and_state @@ -275,9 +273,10 @@ class FederationHandler(BaseHandler): return event - res = map(redact_disallowed, events_and_states) - - logger.info("_filter_events_for_server %r", res) + res = map(redact_disallowed, [ + (e, events_to_state[e.event_id]) + for e in events + ]) defer.returnValue(res) |