summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2020-04-23 12:03:33 -0400
committerPatrick Cloke <patrickc@matrix.org>2020-04-23 12:03:33 -0400
commit204664d1adf95f26a14ff5b6a4635cbac75b044a (patch)
tree2a9eb605318b29d6346c558e99a5a24dce2289d3 /synapse/handlers/device.py
parentRevert "Merge pull request #7315 from matrix-org/babolivier/request_token" (diff)
parent1.12.4 (diff)
downloadsynapse-204664d1adf95f26a14ff5b6a4635cbac75b044a.tar.xz
Merge tag 'v1.12.4'
Synapse v1.12.4

Features:

* Always send users their own device updates. (#7160)
* Add support for handling GET requests for account_data on a worker. (#7311)

Bugfixes:

* Fix a bug that prevented cross-signing with users on worker-mode synapses. (#7255)
* Do not treat display names as globs in push rules. (#7271)
* Fix a bug with cross-signing devices belonging to remote users who did not share a
  room with any user on the local homeserver. (#7289)
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py14
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(