diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-04 14:06:42 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-04 14:06:46 +0000 |
commit | 650e32d45580ddd13826364291bda6760c014df9 (patch) | |
tree | 21098f6310175c946359ebec2bed11894a739fc6 /synapse/api/auth.py | |
parent | Brief comment on why we do some things on every call to persist_event and not... (diff) | |
download | synapse-650e32d45580ddd13826364291bda6760c014df9.tar.xz |
Change context.auth_events to what the auth_events would be bases on context.current_state, rather than based on the auth_events from the event.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r-- | synapse/api/auth.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 3471afd7e7..7105ee21dc 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -358,7 +358,7 @@ class Auth(object): def add_auth_events(self, builder, context): yield run_on_reactor() - auth_ids = self.compute_auth_events(builder, context) + auth_ids = self.compute_auth_events(builder, context.current_state) auth_events_entries = yield self.store.add_event_hashes( auth_ids @@ -372,26 +372,26 @@ class Auth(object): if v.event_id in auth_ids } - def compute_auth_events(self, event, context): + def compute_auth_events(self, event, current_state): if event.type == EventTypes.Create: return [] auth_ids = [] key = (EventTypes.PowerLevels, "", ) - power_level_event = context.current_state.get(key) + power_level_event = current_state.get(key) if power_level_event: auth_ids.append(power_level_event.event_id) key = (EventTypes.JoinRules, "", ) - join_rule_event = context.current_state.get(key) + join_rule_event = current_state.get(key) key = (EventTypes.Member, event.user_id, ) - member_event = context.current_state.get(key) + member_event = current_state.get(key) key = (EventTypes.Create, "", ) - create_event = context.current_state.get(key) + create_event = current_state.get(key) if create_event: auth_ids.append(create_event.event_id) |