Add Element Call room settings (#9347)

Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
Šimon Brandner
2022-10-07 20:10:17 +02:00
committed by GitHub
parent 4ff9681408
commit 26a74a193f
21 changed files with 539 additions and 67 deletions

View File

@@ -46,6 +46,7 @@ import { findDMForUser } from "./utils/dm/findDMForUser";
import { privateShouldBeEncrypted } from "./utils/rooms";
import { waitForMember } from "./utils/membership";
import { PreferredRoomVersions } from "./utils/PreferredRoomVersions";
import SettingsStore from "./settings/SettingsStore";
// we define a number of interfaces which take their names from the js-sdk
/* eslint-disable camelcase */
@@ -168,6 +169,16 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
},
};
}
} else if (SettingsStore.getValue("feature_group_calls")) {
createOpts.power_level_content_override = {
events: {
...DEFAULT_EVENT_POWER_LEVELS,
// Element Call should be disabled by default
[ElementCall.MEMBER_EVENT_TYPE.name]: 100,
// Make sure only admins can enable it
[ElementCall.CALL_EVENT_TYPE.name]: 100,
},
};
}
// By default, view the room after creating it