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

Commit

Permalink
Notify users, rather than rooms, of device list updates (#11905)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
  • Loading branch information
anoadragon453 and clokep committed Feb 12, 2022
1 parent 63c4634 commit 55113dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/11905.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Preparation to support sending device list updates to application services.
8 changes: 3 additions & 5 deletions synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,11 @@ async def notify_device_update(
"Notifying about update %r/%r, ID: %r", user_id, device_id, position
)

room_ids = await self.store.get_rooms_for_user(user_id)

# specify the user ID too since the user should always get their own device list
# updates, even if they aren't in any rooms.
self.notifier.on_new_event(
"device_list_key", position, users=[user_id], rooms=room_ids
)
users_to_notify = users_who_share_room.union({user_id})

self.notifier.on_new_event("device_list_key", position, users=users_to_notify)

if hosts:
logger.info(
Expand Down

0 comments on commit 55113dd

Please sign in to comment.