diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2020-03-30 19:18:00 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2020-03-31 11:26:37 +0100 |
commit | b5d0b038f4f2400dfd3ca7c698638c9821af6086 (patch) | |
tree | e17086cb3011a9a560c6ee1563f15e1329e4d45a /synapse | |
parent | Only setdefault for signatures if device has key_json (diff) | |
download | synapse-b5d0b038f4f2400dfd3ca7c698638c9821af6086.tar.xz |
Fix another instance
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/data_stores/main/devices.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/storage/data_stores/main/devices.py b/synapse/storage/data_stores/main/devices.py index 84d8deca18..8af5f7de54 100644 --- a/synapse/storage/data_stores/main/devices.py +++ b/synapse/storage/data_stores/main/devices.py @@ -527,14 +527,16 @@ class DeviceWorkerStore(SQLBaseStore): key_json = device.get("key_json", None) if key_json: result["keys"] = db_to_json(key_json) + + if "signatures" in device: + for sig_user_id, sigs in device["signatures"].items(): + result["keys"].setdefault("signatures", {}).setdefault( + sig_user_id, {} + ).update(sigs) + device_display_name = device.get("device_display_name", None) if device_display_name: result["device_display_name"] = device_display_name - if "signatures" in device: - for sig_user_id, sigs in device["signatures"].items(): - result["keys"].setdefault("signatures", {}).setdefault( - sig_user_id, {} - ).update(sigs) results.append(result) |