diff --git a/changelog.d/11905.misc b/changelog.d/11905.misc new file mode 100644 index 000000000000..4f170cf01aa0 --- /dev/null +++ b/changelog.d/11905.misc @@ -0,0 +1 @@ +Preparation to support sending device list updates to application services. \ No newline at end of file diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py index b184a48cb16c..36c05f8363b9 100644 --- a/synapse/handlers/device.py +++ b/synapse/handlers/device.py @@ -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(