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

Commit 55113dd

Browse files
Notify users, rather than rooms, of device list updates (#11905)
Co-authored-by: Patrick Cloke <[email protected]>
1 parent 63c4634 commit 55113dd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

changelog.d/11905.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Preparation to support sending device list updates to application services.

synapse/handlers/device.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,13 +495,11 @@ async def notify_device_update(
495495
"Notifying about update %r/%r, ID: %r", user_id, device_id, position
496496
)
497497

498-
room_ids = await self.store.get_rooms_for_user(user_id)
499-
500498
# specify the user ID too since the user should always get their own device list
501499
# updates, even if they aren't in any rooms.
502-
self.notifier.on_new_event(
503-
"device_list_key", position, users=[user_id], rooms=room_ids
504-
)
500+
users_to_notify = users_who_share_room.union({user_id})
501+
502+
self.notifier.on_new_event("device_list_key", position, users=users_to_notify)
505503

506504
if hosts:
507505
logger.info(

0 commit comments

Comments
 (0)