diff options
author | Erik Johnston <erik@matrix.org> | 2017-01-26 16:06:54 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-01-26 16:07:24 +0000 |
commit | c974116f197d211ba9b42159fe61cfd5957411b5 (patch) | |
tree | b4d6e71850ba0d371e0463a5cc99439ce8072c40 /synapse/federation/transport/client.py | |
parent | Fix up sending of m.device_list_update edus (diff) | |
download | synapse-c974116f197d211ba9b42159fe61cfd5957411b5.tar.xz |
Implement device key caching over federation
Diffstat (limited to 'synapse/federation/transport/client.py')
-rw-r--r-- | synapse/federation/transport/client.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py index 915af34409..f49e8a2cc4 100644 --- a/synapse/federation/transport/client.py +++ b/synapse/federation/transport/client.py @@ -348,6 +348,32 @@ class TransportLayerClient(object): @defer.inlineCallbacks @log_function + def query_user_devices(self, destination, user_id, timeout): + """Query the devices for a user id hosted on a remote server. + + Response: + { + "stream_id": "...", + "devices": [ { ... } ] + } + + Args: + destination(str): The server to query. + query_content(dict): The user ids to query. + Returns: + A dict containg the device keys. + """ + path = PREFIX + "/user/devices/" + user_id + + content = yield self.client.get_json( + destination=destination, + path=path, + timeout=timeout, + ) + defer.returnValue(content) + + @defer.inlineCallbacks + @log_function def claim_client_keys(self, destination, query_content, timeout): """Claim one-time keys for a list of devices hosted on a remote server. |