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

Commit

Permalink
Fix MSC3983 support: only one OTK per device was returned through fed…
Browse files Browse the repository at this point in the history
…eration (#15770)
  • Loading branch information
Mathieu Velten authored Jun 13, 2023
1 parent 0757d59 commit 59ec4a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/15770.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix requesting multiple keys at once over federation, related to [MSC3983](/~https://github.com/matrix-org/matrix-spec-proposals/pull/3983).
4 changes: 3 additions & 1 deletion synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,9 @@ async def on_claim_client_keys(
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",
Expand Down

0 comments on commit 59ec4a0

Please sign in to comment.