mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
make sure we actually return something
This commit is contained in:
parent
2208891ace
commit
7a0dce9259
@ -248,6 +248,11 @@ class E2eKeysHandler(object):
|
|||||||
|
|
||||||
results = yield self.store.get_e2e_device_keys(local_query)
|
results = yield self.store.get_e2e_device_keys(local_query)
|
||||||
|
|
||||||
|
# Build the result structure
|
||||||
|
for user_id, device_keys in results.items():
|
||||||
|
for device_id, device_info in device_keys.items():
|
||||||
|
result_dict[user_id][device_id] = device_info
|
||||||
|
|
||||||
log_kv(results)
|
log_kv(results)
|
||||||
return result_dict
|
return result_dict
|
||||||
|
|
||||||
|
@ -56,16 +56,18 @@ class EndToEndKeyWorkerStore(SQLBaseStore):
|
|||||||
|
|
||||||
# Build the result structure, un-jsonify the results, and add the
|
# Build the result structure, un-jsonify the results, and add the
|
||||||
# "unsigned" section
|
# "unsigned" section
|
||||||
|
rv = {}
|
||||||
for user_id, device_keys in iteritems(results):
|
for user_id, device_keys in iteritems(results):
|
||||||
|
rv[user_id] = {}
|
||||||
for device_id, device_info in iteritems(device_keys):
|
for device_id, device_info in iteritems(device_keys):
|
||||||
r = db_to_json(device_info.pop("key_json"))
|
r = db_to_json(device_info.pop("key_json"))
|
||||||
r["unsigned"] = {}
|
r["unsigned"] = {}
|
||||||
display_name = device_info["device_display_name"]
|
display_name = device_info["device_display_name"]
|
||||||
if display_name is not None:
|
if display_name is not None:
|
||||||
r["unsigned"]["device_display_name"] = display_name
|
r["unsigned"]["device_display_name"] = display_name
|
||||||
results[user_id][device_id] = r
|
rv[user_id][device_id] = r
|
||||||
|
|
||||||
return results
|
return rv
|
||||||
|
|
||||||
@trace
|
@trace
|
||||||
def _get_e2e_device_keys_txn(
|
def _get_e2e_device_keys_txn(
|
||||||
|
Loading…
Reference in New Issue
Block a user