This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1+ Implement [MSC 3818: Copy room type on upgrade](https://github.com/matrix-org/matrix-spec-proposals/pull/3818)
Original file line number Diff line number Diff line change @@ -469,13 +469,19 @@ async def clone_existing_room(
469469 (EventTypes .PowerLevels , "" ),
470470 ]
471471
472- # If the old room was a space, copy over the room type and the rooms in
473- # the space.
472+ # Copy the room type as per MSC3818 https://github.com/matrix-org/matrix-spec-proposals/pull/3818.
473+ if (
474+ old_room_create_event .content .get (EventContentFields .ROOM_TYPE )
475+ is not None
476+ ):
477+ creation_content [EventContentFields .ROOM_TYPE ] =
478+ old_room_create_event .content .get (EventContentFields .ROOM_TYPE )
479+
480+ # If the old room was a space, copy over the rooms in the space.
474481 if (
475482 old_room_create_event .content .get (EventContentFields .ROOM_TYPE )
476483 == RoomTypes .SPACE
477484 ):
478- creation_content [EventContentFields .ROOM_TYPE ] = RoomTypes .SPACE
479485 types_to_copy .append ((EventTypes .SpaceChild , None ))
480486
481487 old_room_state_ids = await self .store .get_filtered_current_state_ids (
You can’t perform that action at this time.
0 commit comments