Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix hiding devices names over federation (#10015)
Browse files Browse the repository at this point in the history
And don't include blank opentracing stuff in device list updates.

Signed-off-by: Aaron Raimist <[email protected]>
  • Loading branch information
aaronraimist authored Oct 18, 2022
1 parent 1c777ef commit 2a76a73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/10015.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent device names from appearing in device list updates when `allow_device_name_lookup_over_federation` is `false`.
10 changes: 8 additions & 2 deletions synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,23 @@ async def _get_device_update_edus_by_remote(
"device_id": device_id,
"prev_id": [prev_id] if prev_id else [],
"stream_id": stream_id,
"org.matrix.opentracing_context": opentracing_context,
}

if opentracing_context != "{}":
result["org.matrix.opentracing_context"] = opentracing_context

prev_id = stream_id

if device is not None:
keys = device.keys
if keys:
result["keys"] = keys

device_display_name = device.display_name
device_display_name = None
if (
self.hs.config.federation.allow_device_name_lookup_over_federation
):
device_display_name = device.display_name
if device_display_name:
result["device_display_name"] = device_display_name
else:
Expand Down

0 comments on commit 2a76a73

Please sign in to comment.