summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-13 17:27:46 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-13 17:27:46 +0100
commit0cceb2ac92cde0a4289adfc6e9000c7b1c54bdae (patch)
tree946b40c536c467d8da49ef6bb3bdfce7e6f61a3b
parentGet the end-to-end key federation working (diff)
downloadsynapse-0cceb2ac92cde0a4289adfc6e9000c7b1c54bdae.tar.xz
Add a few strategic new lines to break up the on_query_client_keys and on_claim_client_keys methods in federation_server.py
Diffstat (limited to '')
-rw-r--r--synapse/federation/federation_server.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index c32908ac28..725c6f3fa5 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -323,13 +323,16 @@ class FederationServer(FederationBase):
             else:
                 for device_id in device_ids:
                     query.append((user_id, device_id))
+
         results = yield self.store.get_e2e_device_keys(query)
+
         json_result = {}
         for user_id, device_keys in results.items():
             for device_id, json_bytes in device_keys.items():
                 json_result.setdefault(user_id, {})[device_id] = json.loads(
                     json_bytes
                 )
+
         defer.returnValue({"device_keys": json_result})
 
     @defer.inlineCallbacks
@@ -339,7 +342,9 @@ class FederationServer(FederationBase):
         for user_id, device_keys in content.get("one_time_keys", {}).items():
             for device_id, algorithm in device_keys.items():
                 query.append((user_id, device_id, algorithm))
+
         results = yield self.store.claim_e2e_one_time_keys(query)
+
         json_result = {}
         for user_id, device_keys in results.items():
             for device_id, keys in device_keys.items():
@@ -347,6 +352,7 @@ class FederationServer(FederationBase):
                     json_result.setdefault(user_id, {})[device_id] = {
                         key_id: json.loads(json_bytes)
                     }
+
         defer.returnValue({"one_time_keys": json_result})
 
     @defer.inlineCallbacks