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.
This commit is contained in:
Richard van der Hoff 2020-09-04 15:06:05 +01:00 committed by GitHub
parent 041ee971c9
commit f25af1f9c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 34 deletions

View file

@ -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: