diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-08-04 10:59:51 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-08-04 10:59:51 +0100 |
commit | f131cd9e53b8131c5f7fa71765c717eadd001f16 (patch) | |
tree | 7ead57395d8399ae8c1d9f9ceb0e7af3bf3a9239 /synapse/handlers/e2e_keys.py | |
parent | Merge pull request #978 from matrix-org/rav/device_name_in_e2e_devices (diff) | |
download | synapse-f131cd9e53b8131c5f7fa71765c717eadd001f16.tar.xz |
keys/query: Omit device displayname if null
... which makes it more consistent with user displaynames.
Diffstat (limited to 'synapse/handlers/e2e_keys.py')
-rw-r--r-- | synapse/handlers/e2e_keys.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py index bb69089b91..2c7bfd91ed 100644 --- a/synapse/handlers/e2e_keys.py +++ b/synapse/handlers/e2e_keys.py @@ -122,9 +122,10 @@ class E2eKeysHandler(object): for user_id, device_keys in results.items(): for device_id, device_info in device_keys.items(): r = json.loads(device_info["key_json"]) - r["unsigned"] = { - "device_display_name": device_info["device_display_name"], - } + r["unsigned"] = {} + display_name = device_info["device_display_name"] + if display_name is not None: + r["unsigned"]["device_display_name"] = display_name result_dict[user_id][device_id] = r defer.returnValue(result_dict) |