diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-08-03 14:26:01 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-08-03 14:26:01 +0100 |
commit | e555bc6551169aa1485c3007c95bb79a3d6cc7d6 (patch) | |
tree | 6b76612c541949fae182c52eee55f78a4ed8abfc /synapse/federation | |
parent | Merge pull request #975 from matrix-org/erikj/multi_event_persist (diff) | |
parent | E2eKeysHandler: minor tweaks (diff) | |
download | synapse-e555bc6551169aa1485c3007c95bb79a3d6cc7d6.tar.xz |
Merge branch 'rav/refactor_device_query' into develop
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/federation_server.py | 20 | ||||
-rw-r--r-- | synapse/federation/transport/server.py | 4 |
2 files changed, 2 insertions, 22 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index 612d274bdb..8ec5b190c8 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -372,27 +372,9 @@ class FederationServer(FederationBase): (200, send_content) ) - @defer.inlineCallbacks @log_function def on_query_client_keys(self, origin, content): - query = [] - for user_id, device_ids in content.get("device_keys", {}).items(): - if not device_ids: - query.append((user_id, None)) - 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}) + return self.on_query_request("client_keys", content) @defer.inlineCallbacks @log_function diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py index 26fa88ae84..1a88413d18 100644 --- a/synapse/federation/transport/server.py +++ b/synapse/federation/transport/server.py @@ -367,10 +367,8 @@ class FederationThirdPartyInviteExchangeServlet(BaseFederationServlet): class FederationClientKeysQueryServlet(BaseFederationServlet): PATH = "/user/keys/query" - @defer.inlineCallbacks def on_POST(self, origin, content, query): - response = yield self.handler.on_query_client_keys(origin, content) - defer.returnValue((200, response)) + return self.handler.on_query_client_keys(origin, content) class FederationClientKeysClaimServlet(BaseFederationServlet): |