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

Commit

Permalink
feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikaela committed May 19, 2022
1 parent ae17632 commit 392d6b6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,18 +469,16 @@ async def clone_existing_room(
(EventTypes.PowerLevels, ""),
]

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

# If the old room was a space, copy over the rooms in the space.
if (
old_room_create_event.content.get(EventContentFields.ROOM_TYPE)
== RoomTypes.SPACE
):
types_to_copy.append((EventTypes.SpaceChild, None))
# If the old room was a space, copy over the rooms in the space.
if room_type == RoomTypes.SPACE:
types_to_copy.append((EventTypes.SpaceChild, None))

old_room_state_ids = await self.store.get_filtered_current_state_ids(
old_room_id, StateFilter.from_types(types_to_copy)
Expand Down

0 comments on commit 392d6b6

Please sign in to comment.