@@ -1886,38 +1886,13 @@ async def _generate_sync_entry_for_device_list(
1886
1886
1887
1887
# Step 1a, check for changes in devices of users we share a room
1888
1888
# with
1889
- #
1890
- # We do this in two different ways depending on what we have cached.
1891
- # If we already have a list of all the user that have changed since
1892
- # the last sync then it's likely more efficient to compare the rooms
1893
- # they're in with the rooms the syncing user is in.
1894
- #
1895
- # If we don't have that info cached then we get all the users that
1896
- # share a room with our user and check if those users have changed.
1897
- cache_result = self .store .get_cached_device_list_changes (
1898
- since_token .device_list_key
1899
- )
1900
- if cache_result .hit :
1901
- changed_users = cache_result .entities
1902
-
1903
- result = await self .store .get_rooms_for_users (changed_users )
1904
-
1905
- for changed_user_id , entries in result .items ():
1906
- # Check if the changed user shares any rooms with the user,
1907
- # or if the changed user is the syncing user (as we always
1908
- # want to include device list updates of their own devices).
1909
- if user_id == changed_user_id or any (
1910
- rid in joined_room_ids for rid in entries
1911
- ):
1912
- users_that_have_changed .add (changed_user_id )
1913
- else :
1914
- users_that_have_changed = (
1915
- await self ._device_handler .get_device_changes_in_shared_rooms (
1916
- user_id ,
1917
- sync_result_builder .joined_room_ids ,
1918
- from_token = since_token ,
1919
- )
1889
+ users_that_have_changed = (
1890
+ await self ._device_handler .get_device_changes_in_shared_rooms (
1891
+ user_id ,
1892
+ sync_result_builder .joined_room_ids ,
1893
+ from_token = since_token ,
1920
1894
)
1895
+ )
1921
1896
1922
1897
# Step 1b, check for newly joined rooms
1923
1898
for room_id in newly_joined_rooms :
0 commit comments