From 62bdfe1ce8e6400e3ac84a46eb1637a946c8f9d7 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 17 Jul 2025 23:15:14 +0100 Subject: [PATCH] feat(space-upgrades): Copy over space child & parent states --- src/api/client/room/upgrade.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/client/room/upgrade.rs b/src/api/client/room/upgrade.rs index ae632235..afd6f70e 100644 --- a/src/api/client/room/upgrade.rs +++ b/src/api/client/room/upgrade.rs @@ -24,7 +24,7 @@ use serde_json::{json, value::to_raw_value}; use crate::Ruma; /// Recommended transferable state events list from the spec -const TRANSFERABLE_STATE_EVENTS: &[StateEventType; 9] = &[ +const TRANSFERABLE_STATE_EVENTS: &[StateEventType; 11] = &[ StateEventType::RoomAvatar, StateEventType::RoomEncryption, StateEventType::RoomGuestAccess, @@ -34,6 +34,9 @@ const TRANSFERABLE_STATE_EVENTS: &[StateEventType; 9] = &[ StateEventType::RoomPowerLevels, StateEventType::RoomServerAcl, StateEventType::RoomTopic, + // Not explicitly recommended in spec, but very useful. + StateEventType::SpaceChild, + StateEventType::SpaceParent, // TODO: m.room.policy ]; /// # `POST /_matrix/client/r0/rooms/{roomId}/upgrade` @@ -50,10 +53,7 @@ pub(crate) async fn upgrade_room_route( State(services): State, body: Ruma, ) -> Result { - debug_assert!( - TRANSFERABLE_STATE_EVENTS.is_sorted(), - "TRANSFERABLE_STATE_EVENTS is not sorted" - ); + // TODO[v12]: Handle additional creators let sender_user = body.sender_user.as_ref().expect("user is authenticated"); if !services.server.supported_room_version(&body.new_version) {