summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2016-07-21 17:00:26 +0100
committerGitHub <noreply@github.com>2016-07-21 17:00:26 +0100
commit68a92afcffa6d642398c5eac6ee0beeadd6e97d3 (patch)
tree5d577d5b181506be155252525db762bb922bf216 /synapse/handlers
parentMerge pull request #943 from matrix-org/rav/get_device_api (diff)
parentmake /devices return a list (diff)
downloadsynapse-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.py10
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)