diff options
author | David Baker <dbkr@users.noreply.github.com> | 2016-07-21 17:00:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-21 17:00:26 +0100 |
commit | 68a92afcffa6d642398c5eac6ee0beeadd6e97d3 (patch) | |
tree | 5d577d5b181506be155252525db762bb922bf216 /synapse | |
parent | Merge pull request #943 from matrix-org/rav/get_device_api (diff) | |
parent | make /devices return a list (diff) | |
download | synapse-68a92afcffa6d642398c5eac6ee0beeadd6e97d3.tar.xz |
Merge pull request #944 from matrix-org/rav/devices_returns_list
make /devices return a list
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/device.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py index 110f5fbb5c..1f9e15c33c 100644 --- a/synapse/handlers/device.py +++ b/synapse/handlers/device.py @@ -79,17 +79,17 @@ class DeviceHandler(BaseHandler): Args: user_id (str): Returns: - defer.Deferred: dict[str, dict[str, X]]: map from device_id to - info on the device + defer.Deferred: list[dict[str, X]]: info on each device """ - devices = yield self.store.get_devices_by_user(user_id) + device_map = yield self.store.get_devices_by_user(user_id) ips = yield self.store.get_last_client_ip_by_device( - devices=((user_id, device_id) for device_id in devices.keys()) + devices=((user_id, device_id) for device_id in device_map.keys()) ) - for device in devices.values(): + devices = device_map.values() + for device in devices: _update_device_from_client_ips(device, ips) defer.returnValue(devices) |