diff options
author | David Baker <dbkr@users.noreply.github.com> | 2020-03-30 14:34:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-30 14:34:28 +0100 |
commit | 07569f25d10daeffe25e4f9763175d70b69aec1c (patch) | |
tree | bd0f403060da03ac5f3ece68b1b0157f58a5fc6d /synapse/handlers/device.py | |
parent | Merge pull request #7157 from matrix-org/rev.outbound_device_pokes_tests (diff) | |
parent | Add explanatory comment (diff) | |
download | synapse-07569f25d10daeffe25e4f9763175d70b69aec1c.tar.xz |
Merge pull request #7160 from matrix-org/dbkr/always_send_own_device_list_updates
Always send the user updates to their own device list
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r-- | synapse/handlers/device.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py index a514c30714..993499f446 100644 --- a/synapse/handlers/device.py +++ b/synapse/handlers/device.py @@ -125,8 +125,14 @@ class DeviceWorkerHandler(BaseHandler): users_who_share_room = yield self.store.get_users_who_share_room_with_user( user_id ) + + tracked_users = set(users_who_share_room) + + # Always tell the user about their own devices + tracked_users.add(user_id) + changed = yield self.store.get_users_whose_devices_changed( - from_token.device_list_key, users_who_share_room + from_token.device_list_key, tracked_users ) # Then work out if any users have since joined @@ -456,7 +462,11 @@ class DeviceHandler(DeviceWorkerHandler): room_ids = yield self.store.get_rooms_for_user(user_id) - yield self.notifier.on_new_event("device_list_key", position, rooms=room_ids) + # specify the user ID too since the user should always get their own device list + # updates, even if they aren't in any rooms. + yield self.notifier.on_new_event( + "device_list_key", position, users=[user_id], rooms=room_ids + ) if hosts: logger.info( |