Set message power to moderator in space (#2684)
This commit is contained in:
parent
826b3c2997
commit
a9022184fc
1 changed files with 8 additions and 0 deletions
|
|
@ -74,6 +74,10 @@ export const createRoomParentState = (parent: Room) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const createSpacePowerLevelsOverride = () => ({
|
||||||
|
events_default: 50,
|
||||||
|
});
|
||||||
|
|
||||||
export const createRoomEncryptionState = () => ({
|
export const createRoomEncryptionState = () => ({
|
||||||
type: 'm.room.encryption',
|
type: 'm.room.encryption',
|
||||||
state_key: '',
|
state_key: '',
|
||||||
|
|
@ -121,6 +125,10 @@ export const createRoom = async (mx: MatrixClient, data: CreateRoomData): Promis
|
||||||
initial_state: initialState,
|
initial_state: initialState,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (data.type === RoomType.Space) {
|
||||||
|
options.power_level_content_override = createSpacePowerLevelsOverride();
|
||||||
|
}
|
||||||
|
|
||||||
const result = await mx.createRoom(options);
|
const result = await mx.createRoom(options);
|
||||||
|
|
||||||
if (data.parent) {
|
if (data.parent) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue