summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2023-01-28 17:52:14 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2023-01-28 17:52:14 +0100
commit813bab78cee0bf5e0db9d3dd48315c128e02bba3 (patch)
tree564dea40b47819fa1eb3bb4f1a23c4abea4c4ba8
parentDon't send device names over federation if msc3480 is enabled (diff)
downloadsynapse-813bab78cee0bf5e0db9d3dd48315c128e02bba3.tar.xz
Ignore remote device displaynames if MSC3480 enabled
-rw-r--r--synapse/handlers/e2e_keys.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py
index d2188ca08f..8eca6b1381 100644
--- a/synapse/handlers/e2e_keys.py
+++ b/synapse/handlers/e2e_keys.py
@@ -204,8 +204,15 @@ class E2eKeysHandler:
                 for user_id, devices in remote_results.items():
                     user_devices = results.setdefault(user_id, {})
                     for device_id, device in devices.items():
-                        keys = device.get("keys", None)
-                        device_display_name = device.get("device_display_name", None)
+                        keys = device.get("keys")
+
+                        # Extract the displayname of the remote device
+                        device_display_name = None
+                        if self.config.experimental.msc3480_enabled is not True:
+                            # Ignore remote device names if experimental MSC3480 support
+                            # is enabled.
+                            device_display_name = device.get("device_display_name")
+
                         if keys:
                             result = dict(keys)
                             unsigned = result.setdefault("unsigned", {})