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

Commit

Permalink
Simplify check for user in room
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Oct 4, 2022
1 parent 516dd2c commit ef2950a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,13 +1361,7 @@ async def generate_sync_result(
# User joined a room - we have to then check the room state to ensure we
# respect any bans if there's a race between the join and ban events.
if event.membership == Membership.JOIN:
assert event.internal_metadata.stream_ordering
extrems = await self.store.get_forward_extremities_for_room_at_stream_ordering(
room_id, event.internal_metadata.stream_ordering
)
user_ids_in_room = await self.state.get_current_user_ids_in_room(
room_id, extrems
)
user_ids_in_room = await self.store.get_users_in_room(room_id)
if user_id in user_ids_in_room:
mutable_joined_room_ids.add(room_id)
# The user left the room, or left and was re-invited but not joined yet
Expand Down

0 comments on commit ef2950a

Please sign in to comment.