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

Commit a5deabb

Browse files
author
David Robertson
committed
Remove check on events[-1].membership
I claim this check is redundant, because said membership cannot be join. If not, we'd have `continue`d above because `room_id` would be in `sync_result_builder.joined_room_ids`.
1 parent 0d0783c commit a5deabb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

synapse/handlers/sync.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1878,15 +1878,11 @@ async def _classify_rooms_by_membership_changes(
18781878
# 2. Should we add this to `newly_left_rooms`?
18791879
# Check if we have left the room. This can either be because we were
18801880
# joined before *or* that we since joined and then left.
1881-
if events[-1].membership != Membership.JOIN:
1882-
if has_join:
1881+
if has_join:
1882+
newly_left_rooms.append(room_id)
1883+
else:
1884+
if old_mem_ev is not None and old_mem_ev.membership == Membership.JOIN:
18831885
newly_left_rooms.append(room_id)
1884-
else:
1885-
if (
1886-
old_mem_ev is not None
1887-
and old_mem_ev.membership == Membership.JOIN
1888-
):
1889-
newly_left_rooms.append(room_id)
18901886

18911887
# 3. Should we add this room to `invited`?
18921888
# Only bother if we're still currently invited

0 commit comments

Comments
 (0)