From 0bd54de6401fce068a1697c1fa3e8c36a4025875 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 20 Jan 2023 15:39:28 +0000 Subject: [PATCH] Mark retransmitted rooms as newly_joined --- synapse/handlers/sync.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 300cdff82041..212186b1cee3 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -1981,7 +1981,7 @@ async def _get_room_changes_for_incremental_sync( for event in membership_change_events: mem_change_events_by_room_id.setdefault(event.room_id, []).append(event) - newly_joined_rooms: List[str] = [] + newly_joined_rooms: List[str] = list(sync_result_builder.retransmit_room_ids) newly_left_rooms: List[str] = [] room_entries: List[RoomSyncResultBuilder] = [] invited: List[InvitedSyncResult] = [] @@ -2004,9 +2004,7 @@ async def _get_room_changes_for_incremental_sync( # we do send down the room, and with full state, where necessary old_state_ids = None - if room_id in sync_result_builder.joined_room_ids and ( - non_joins or room_id in sync_result_builder.retransmit_room_ids - ): + if room_id in sync_result_builder.joined_room_ids and non_joins: # Always include if the user (re)joined the room, especially # important so that device list changes are calculated correctly. # If there are non-join member events, but we are still in the room,