diff options
author | Erik Johnston <erik@matrix.org> | 2017-01-26 16:30:37 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-01-26 16:33:21 +0000 |
commit | fbfad76c03afe7538c67205ceb30825d9ce4fb07 (patch) | |
tree | e55a45bf12542f968fa1099af8fdd368a24331b5 /synapse/handlers/e2e_keys.py | |
parent | Implement device key caching over federation (diff) | |
download | synapse-fbfad76c03afe7538c67205ceb30825d9ce4fb07.tar.xz |
Add comments
Diffstat (limited to 'synapse/handlers/e2e_keys.py')
-rw-r--r-- | synapse/handlers/e2e_keys.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py index 832998a6d3..a16b9def8d 100644 --- a/synapse/handlers/e2e_keys.py +++ b/synapse/handlers/e2e_keys.py @@ -75,7 +75,7 @@ class E2eKeysHandler(object): else: remote_queries[user_id] = device_ids - # do the queries + # Firt get local devices. failures = {} results = {} if local_query: @@ -84,6 +84,7 @@ class E2eKeysHandler(object): if user_id in local_query: results[user_id] = keys + # Now attempt to get any remote devices from our local cache. remote_queries_not_in_cache = {} if remote_queries: query_list = [] @@ -115,6 +116,7 @@ class E2eKeysHandler(object): r = remote_queries_not_in_cache.setdefault(domain, {}) r[user_id] = remote_queries[user_id] + # Now fetch any devices that we don't have in our cache @defer.inlineCallbacks def do_remote_query(destination): destination_query = remote_queries_not_in_cache[destination] |