Use EventType at the space create sites and augment the room kind key. [skip build]
This commit is contained in:
@@ -56,7 +56,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
|
||||
// Set m.space.parent on the new room pointing to parent
|
||||
await mx.sendStateEvent(
|
||||
newRoomId,
|
||||
StateEvent.SpaceParent,
|
||||
EventType.SpaceParent,
|
||||
{
|
||||
canonical: true,
|
||||
via: viaServers,
|
||||
@@ -67,7 +67,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
|
||||
// Set m.space.child on the parent room pointing to this sub-room
|
||||
await mx.sendStateEvent(
|
||||
parentSubRoomId,
|
||||
StateEvent.SpaceChild,
|
||||
EventType.SpaceChild,
|
||||
{ via: viaServers },
|
||||
newRoomId,
|
||||
);
|
||||
@@ -79,7 +79,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
|
||||
);
|
||||
if (parentJoinRulesEvent) {
|
||||
const joinRulesContent = parentJoinRulesEvent.getContent();
|
||||
await mx.sendStateEvent(newRoomId, StateEvent.RoomJoinRules, joinRulesContent, '');
|
||||
await mx.sendStateEvent(newRoomId, EventType.RoomJoinRules, joinRulesContent, '');
|
||||
}
|
||||
|
||||
// Add new room to parent's sub-rooms list
|
||||
@@ -89,12 +89,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
|
||||
const newContent: PaarrotSubRoomsContent = {
|
||||
children: [...currentChildren, newRoomId],
|
||||
};
|
||||
await mx.sendStateEvent(
|
||||
parentSubRoomId,
|
||||
StateEvent.PaarrotSubRooms as any,
|
||||
newContent,
|
||||
'',
|
||||
);
|
||||
await mx.sendStateEvent(parentSubRoomId, StateEvent.PaarrotSubRooms, newContent, '');
|
||||
|
||||
// Also add sub-room to parent's space(s) for joining/permissions
|
||||
// The UI will hide it from the top-level display and only show it nested
|
||||
|
||||
Reference in New Issue
Block a user