From 85b77e277f9f5e3d5c18e0858d8bcd0e459a5aae Mon Sep 17 00:00:00 2001 From: Robert Long Date: Mon, 18 Apr 2022 21:57:50 -0700 Subject: [PATCH] Add power_level_content_override to create room --- src/matrix/room/RoomBeingCreated.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/matrix/room/RoomBeingCreated.ts b/src/matrix/room/RoomBeingCreated.ts index 78202203..c92db5fe 100644 --- a/src/matrix/room/RoomBeingCreated.ts +++ b/src/matrix/room/RoomBeingCreated.ts @@ -38,6 +38,7 @@ type CreateRoomPayload = { room_alias_name?: string; creation_content?: {"m.federate": boolean}; initial_state: {type: string; state_key: string; content: Record}[] + power_level_content_override?: any; } type ImageInfo = { @@ -62,6 +63,7 @@ type Options = { invites?: string[]; avatar?: Avatar; alias?: string; + powerLevelContentOverride?: any; } function defaultE2EEStatusForType(type: RoomType): boolean { @@ -161,6 +163,9 @@ export class RoomBeingCreated extends EventEmitter<{change: never}> { content: avatarEventContent }); } + if (this.options.powerLevelContentOverride) { + createOptions.power_level_content_override = this.options.powerLevelContentOverride; + } const response = await hsApi.createRoom(createOptions, {log}).response(); this._roomId = response["room_id"]; } catch (err) {