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

Fix hiding devices names over federation #10015

Merged
merged 7 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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