diff options
author | Erik Johnston <erikj@jki.re> | 2018-07-23 15:14:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 15:14:39 +0100 |
commit | 9c294ea864e630d9accc1009be8817e94d1be4d8 (patch) | |
tree | e53ae887887d0e1aecea4a867714ae57144c1929 /synapse/api/auth.py | |
parent | Merge pull request #3577 from matrix-org/erikj/cleanup_context (diff) | |
parent | Update docstrings to make sense (diff) | |
download | synapse-9c294ea864e630d9accc1009be8817e94d1be4d8.tar.xz |
Merge pull request #3579 from matrix-org/erikj/stateless_contexts_4
Add concept of StatelessContext, take 4.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r-- | synapse/api/auth.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index bc629832d9..535bdb449d 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -65,8 +65,9 @@ class Auth(object): @defer.inlineCallbacks def check_from_context(self, event, context, do_sig_check=True): + prev_state_ids = yield context.get_prev_state_ids(self.store) auth_events_ids = yield self.compute_auth_events( - event, context.prev_state_ids, for_verification=True, + event, prev_state_ids, for_verification=True, ) auth_events = yield self.store.get_events(auth_events_ids) auth_events = { @@ -544,7 +545,8 @@ class Auth(object): @defer.inlineCallbacks def add_auth_events(self, builder, context): - auth_ids = yield self.compute_auth_events(builder, context.prev_state_ids) + prev_state_ids = yield context.get_prev_state_ids(self.store) + auth_ids = yield self.compute_auth_events(builder, prev_state_ids) auth_events_entries = yield self.store.add_event_hashes( auth_ids |