room shit
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user