Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c98bbfc

Browse files
committed
Replace calls to get_rooms_for_users_with_stream_ordering
None of the calls to this function ever use the stream ordering component returned, so can just use the simplified `get_rooms_for_users`.
1 parent 1008106 commit c98bbfc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

synapse/handlers/device.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ async def get_user_ids_changed(
271271
possibly_left = possibly_changed | possibly_left
272272

273273
# Double check if we still share rooms with the given user.
274-
users_rooms = await self.store.get_rooms_for_users_with_stream_ordering(
274+
users_rooms = await self.store.get_rooms_for_users(
275275
possibly_left
276276
)
277277
for changed_user_id, entries in users_rooms.items():
278-
if any(e.room_id in room_ids for e in entries):
278+
if any(room_id in room_ids for room_id in entries):
279279
possibly_left.discard(changed_user_id)
280280
else:
281281
possibly_joined.discard(changed_user_id)

synapse/handlers/sync.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ async def _generate_sync_entry_for_device_list(
14741474
since_token.device_list_key
14751475
)
14761476
if changed_users is not None:
1477-
result = await self.store.get_rooms_for_users_with_stream_ordering(
1477+
result = await self.store.get_rooms_for_users(
14781478
changed_users
14791479
)
14801480

@@ -1483,7 +1483,7 @@ async def _generate_sync_entry_for_device_list(
14831483
# or if the changed user is the syncing user (as we always
14841484
# want to include device list updates of their own devices).
14851485
if user_id == changed_user_id or any(
1486-
e.room_id in joined_rooms for e in entries
1486+
rid in joined_rooms for rid in entries
14871487
):
14881488
users_that_have_changed.add(changed_user_id)
14891489
else:
@@ -1518,12 +1518,12 @@ async def _generate_sync_entry_for_device_list(
15181518

15191519
# Remove any users that we still share a room with.
15201520
left_users_rooms = (
1521-
await self.store.get_rooms_for_users_with_stream_ordering(
1521+
await self.store.get_rooms_for_users(
15221522
newly_left_users
15231523
)
15241524
)
15251525
for user_id, entries in left_users_rooms.items():
1526-
if any(e.room_id in joined_rooms for e in entries):
1526+
if any(rid in joined_rooms for rid in entries):
15271527
newly_left_users.discard(user_id)
15281528

15291529
return DeviceListUpdates(

0 commit comments

Comments
 (0)