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(
469
469
(EventTypes .PowerLevels , "" ),
470
470
]
471
471
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.
474
481
if (
475
482
old_room_create_event .content .get (EventContentFields .ROOM_TYPE )
476
483
== RoomTypes .SPACE
477
484
):
478
- creation_content [EventContentFields .ROOM_TYPE ] = RoomTypes .SPACE
479
485
types_to_copy .append ((EventTypes .SpaceChild , None ))
480
486
481
487
old_room_state_ids = await self .store .get_filtered_current_state_ids (
You can’t perform that action at this time.
0 commit comments