Add power_level_content_override to create room

This commit is contained in:
Robert Long 2022-04-18 21:57:50 -07:00
parent 468a0a9698
commit 85b77e277f

View file

@ -38,6 +38,7 @@ type CreateRoomPayload = {
room_alias_name?: string;
creation_content?: {"m.federate": boolean};
initial_state: {type: string; state_key: string; content: Record<string, any>}[]
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) {