summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorMathieu Velten <mathieuv@matrix.org>2023-06-13 19:51:47 +0200
committerGitHub <noreply@github.com>2023-06-13 19:51:47 +0200
commit59ec4a0dc1404991935e3c29abe548affa0446bf (patch)
tree697be72326a119dca49794bc7e1f2a1bfed95877 /synapse/federation
parentAvoid backfill when we already have messages to return (#15737) (diff)
downloadsynapse-59ec4a0dc1404991935e3c29abe548affa0446bf.tar.xz
Fix MSC3983 support: only one OTK per device was returned through federation (#15770)
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/federation_server.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index 9425b32507..61fa3b30af 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -1016,7 +1016,9 @@ class FederationServer(FederationBase):
             for user_id, device_keys in result.items():
                 for device_id, keys in device_keys.items():
                     for key_id, key in keys.items():
-                        json_result.setdefault(user_id, {})[device_id] = {key_id: key}
+                        json_result.setdefault(user_id, {}).setdefault(device_id, {})[
+                            key_id
+                        ] = key
 
         logger.info(
             "Claimed one-time-keys: %s",