diff options
author | Erik Johnston <erikj@jki.re> | 2016-09-01 14:20:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-01 14:20:42 +0100 |
commit | 44982606ee7486f970cbfab545e77c10892fd672 (patch) | |
tree | 91c6ff57c8b781b772044e303450322e101a34c8 /synapse/api/auth.py | |
parent | Lower get_linearized_receipts_for_room cache size (diff) | |
parent | Use state_groups table to test existence (diff) | |
download | synapse-44982606ee7486f970cbfab545e77c10892fd672.tar.xz |
Merge pull request #1060 from matrix-org/erikj/state_ids
Assign state groups in state handler.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r-- | synapse/api/auth.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index f26e585623..dcda40863f 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -66,7 +66,7 @@ class Auth(object): @defer.inlineCallbacks def check_from_context(self, event, context, do_sig_check=True): auth_events_ids = yield self.compute_auth_events( - event, context.current_state_ids, for_verification=True, + event, context.prev_state_ids, for_verification=True, ) auth_events = yield self.store.get_events(auth_events_ids) auth_events = { @@ -281,11 +281,13 @@ class Auth(object): with Measure(self.clock, "check_host_in_room"): latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id) - group, curr_state_ids = yield self.state.resolve_state_groups( + entry = yield self.state.resolve_state_groups( room_id, latest_event_ids ) - ret = yield self.store.is_host_joined(room_id, host, group, curr_state_ids) + ret = yield self.store.is_host_joined( + room_id, host, entry.state_group, entry.state + ) defer.returnValue(ret) def check_event_sender_in_room(self, event, auth_events): @@ -852,7 +854,7 @@ class Auth(object): @defer.inlineCallbacks def add_auth_events(self, builder, context): - auth_ids = yield self.compute_auth_events(builder, context.current_state_ids) + auth_ids = yield self.compute_auth_events(builder, context.prev_state_ids) auth_events_entries = yield self.store.add_event_hashes( auth_ids |