Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Clarifications from review.
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
  • Loading branch information
clokep and squahtx authored May 5, 2023
commit d905229825e5e1efeabfb466f93c1e87587a49d5
2 changes: 1 addition & 1 deletion changelog.d/15539.misc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Proxy `/user/devices` federation queries to application serivces for [MSC3984](https://github.com/matrix-org/matrix-spec-proposals/pull/3984).
Proxy `/user/devices` federation queries to application services for [MSC3984](https://github.com/matrix-org/matrix-spec-proposals/pull/3984).
5 changes: 3 additions & 2 deletions synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,13 @@ async def on_federation_query_user_devices(self, user_id: str) -> JsonDict:
# Query the appservices for any keys.
appservice_results = await self._appservice_handler.query_keys(query)

# Merge results, overriding anything in the database.
# Merge results, overriding anything from the database.
appservice_devices = appservice_results.get("device_keys", {}).get(
user_id, {}
)

# Filter the database to only those the appservice has *not* responded with.
# Filter the database results to only those devices that the appservice has
# *not* responded with.
devices = [d for d in devices if d["device_id"] not in appservice_devices]
# Add a slimmed down appservice response.
devices.extend(
Expand Down