mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-25 12:35:01 +01:00
Add power_level_content_override to create room
This commit is contained in:
parent
468a0a9698
commit
85b77e277f
@ -38,6 +38,7 @@ type CreateRoomPayload = {
|
|||||||
room_alias_name?: string;
|
room_alias_name?: string;
|
||||||
creation_content?: {"m.federate": boolean};
|
creation_content?: {"m.federate": boolean};
|
||||||
initial_state: {type: string; state_key: string; content: Record<string, any>}[]
|
initial_state: {type: string; state_key: string; content: Record<string, any>}[]
|
||||||
|
power_level_content_override?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ImageInfo = {
|
type ImageInfo = {
|
||||||
@ -62,6 +63,7 @@ type Options = {
|
|||||||
invites?: string[];
|
invites?: string[];
|
||||||
avatar?: Avatar;
|
avatar?: Avatar;
|
||||||
alias?: string;
|
alias?: string;
|
||||||
|
powerLevelContentOverride?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultE2EEStatusForType(type: RoomType): boolean {
|
function defaultE2EEStatusForType(type: RoomType): boolean {
|
||||||
@ -161,6 +163,9 @@ export class RoomBeingCreated extends EventEmitter<{change: never}> {
|
|||||||
content: avatarEventContent
|
content: avatarEventContent
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (this.options.powerLevelContentOverride) {
|
||||||
|
createOptions.power_level_content_override = this.options.powerLevelContentOverride;
|
||||||
|
}
|
||||||
const response = await hsApi.createRoom(createOptions, {log}).response();
|
const response = await hsApi.createRoom(createOptions, {log}).response();
|
||||||
this._roomId = response["room_id"];
|
this._roomId = response["room_id"];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user