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

Commit 392d6b6

Browse files
committed
feedback from review
1 parent ae17632 commit 392d6b6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

synapse/handlers/room.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,18 +469,16 @@ async def clone_existing_room(
469469
(EventTypes.PowerLevels, ""),
470470
]
471471

472-
# Copy the room type as per MSC3818 https://github.com/matrix-org/matrix-spec-proposals/pull/3818.
473-
if old_room_create_event.content.get(EventContentFields.ROOM_TYPE) is not None:
472+
# Copy the room type as per MSC3818.
473+
room_type = old_room_create_event.content.get(EventContentFields.ROOM_TYPE)
474+
if room_type is not None:
474475
creation_content[
475476
EventContentFields.ROOM_TYPE
476477
] = old_room_create_event.content.get(EventContentFields.ROOM_TYPE)
477478

478-
# If the old room was a space, copy over the rooms in the space.
479-
if (
480-
old_room_create_event.content.get(EventContentFields.ROOM_TYPE)
481-
== RoomTypes.SPACE
482-
):
483-
types_to_copy.append((EventTypes.SpaceChild, None))
479+
# If the old room was a space, copy over the rooms in the space.
480+
if room_type == RoomTypes.SPACE:
481+
types_to_copy.append((EventTypes.SpaceChild, None))
484482

485483
old_room_state_ids = await self.store.get_filtered_current_state_ids(
486484
old_room_id, StateFilter.from_types(types_to_copy)

0 commit comments

Comments
 (0)