room shit

This commit is contained in:
2026-07-10 21:35:38 +10:00
parent 9c7f71896c
commit 5374c10c61
3 changed files with 13 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ import { useMatrixClient } from '../../hooks/useMatrixClient';
import { AsyncStatus, useAsyncCallback } from '../../hooks/useAsyncCallback';
import { ErrorCode } from '../../cs-errorcode';
import { millisecondsToMinutes } from '../../utils/common';
import { createRoomEncryptionState, createRoomPowerLevelsState } from '../../components/create-room';
import { createRoomEncryptionState } from '../../components/create-room';
import { useAlive } from '../../hooks/useAlive';
import { getDirectRoomPath } from '../../pages/pathUtils';
@@ -28,9 +28,10 @@ export function CreateChat({ defaultUserId }: CreateChatProps) {
const [createState, create] = useAsyncCallback<string, Error | MatrixError, [string, boolean]>(
useCallback(
async (userId, encrypted) => {
// Do not put m.room.power_levels in initial_state — incomplete PL events
// (used for org.matrix.msc3401.call.member) cause M_FORBIDDEN / 403 on create.
// TrustedPrivateChat already gives both users PL 100, so call membership works.
const initialState: ICreateRoomStateEvent[] = [];
initialState.push(createRoomPowerLevelsState());
if (encrypted) initialState.push(createRoomEncryptionState());
const result = await mx.createRoom({