summary refs log tree commit diff
path: root/synapse/storage/databases/main/devices.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-09-04 15:06:05 +0100
committerGitHub <noreply@github.com>2020-09-04 15:06:05 +0100
commitf25af1f9c72f1bf8645eca14fc2d8db13f51a9f3 (patch)
treec01fba3eb13108320134ee150dd06255d4c274a2 /synapse/storage/databases/main/devices.py
parentUnread counts fixes (#8254) (diff)
downloadsynapse-f25af1f9c72f1bf8645eca14fc2d8db13f51a9f3.tar.xz
Add cross-signing sigs to the `keys` object (#8234)
All the callers want this info in the same place, so let's reduce the
duplication by doing it here.
Diffstat (limited to 'synapse/storage/databases/main/devices.py')
-rw-r--r--synapse/storage/databases/main/devices.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/synapse/storage/databases/main/devices.py b/synapse/storage/databases/main/devices.py

index f8fe948122..add4e3ea0e 100644 --- a/synapse/storage/databases/main/devices.py +++ b/synapse/storage/databases/main/devices.py
@@ -291,15 +291,9 @@ class DeviceWorkerStore(SQLBaseStore): prev_id = stream_id if device is not None: - key_json = device.key_json - if key_json: - result["keys"] = db_to_json(key_json) - - if device.signatures: - for sig_user_id, sigs in device.signatures.items(): - result["keys"].setdefault("signatures", {}).setdefault( - sig_user_id, {} - ).update(sigs) + keys = device.keys + if keys: + result["keys"] = keys device_display_name = device.display_name if device_display_name: