diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-07-08 15:49:23 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-07-08 15:49:23 +0100 |
commit | 57eacee4f4cff3a663a6e22834a82f9c5783a56d (patch) | |
tree | b5714f78b8c129ad8aca1689e2d7ddecb20c3bed /synapse/handlers/device.py | |
parent | Changelog (diff) | |
parent | Update ModuleApi to avoid register(generate_token=True) (#5640) (diff) | |
download | synapse-57eacee4f4cff3a663a6e22834a82f9c5783a56d.tar.xz |
Merge branch 'develop' into babolivier/invite-json
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r-- | synapse/handlers/device.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py index f59d0479b5..99e8413092 100644 --- a/synapse/handlers/device.py +++ b/synapse/handlers/device.py @@ -101,9 +101,13 @@ class DeviceWorkerHandler(BaseHandler): room_ids = yield self.store.get_rooms_for_user(user_id) - # First we check if any devices have changed - changed = yield self.store.get_user_whose_devices_changed( - from_token.device_list_key + # First we check if any devices have changed for users that we share + # rooms with. + users_who_share_room = yield self.store.get_users_who_share_room_with_user( + user_id + ) + changed = yield self.store.get_users_whose_devices_changed( + from_token.device_list_key, users_who_share_room ) # Then work out if any users have since joined @@ -188,10 +192,6 @@ class DeviceWorkerHandler(BaseHandler): break if possibly_changed or possibly_left: - users_who_share_room = yield self.store.get_users_who_share_room_with_user( - user_id - ) - # Take the intersection of the users whose devices may have changed # and those that actually still share a room with the user possibly_joined = possibly_changed & users_who_share_room |