Allow disabling legacy calls and make Voice & Video settings Legacy Voice & Video (#33692)
* Change `feature_group_calls` to default to true. Change state to Beta * Add `enableLegacyCallsVoip` (clarify: Audio settings relate to Legacy) Change `element_call.use_exclusively` to just be the default of `enableLegacyCallsVoip`. Allow disabling in Legacy in the settings. (overwrite `use_exclusivly` via `enableLegacyCallsVoip`) Rename `Voice & Video` to `Legacy Voice & Video` * improvements - settings title update to only show legacy when appropriate - hide menu all together if use_exclusivly is chosen * simplify by removing the feature_group_calls flag * smaller cleanup * fix tests and cleanup * clarify settings (disable) in config.md * add back EC relevant settings in room settings dialog * update screenshots (now default to EC enabled (not disabled) -> show voice and video tab in room settings * update screenshots * always show option to control voice messages input * lint * fix test * disable -> enabled And only have on mic dropdown * update config.md * Back to `disabled` (on by default/no config) * remove element call hint from voice-video settings * Update apps/web/src/i18n/strings/en_EN.json Co-authored-by: Robin <robin@robin.town> * Update apps/web/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx Co-authored-by: Robin <robin@robin.town> * review * cleanup element call url setting (its deprecated/not used anymore) * clarify, that also jisti will be enabled/disabled by legacy settings flag * remove double section * remove unn exassary element_call configurations * Update en_EN.json * Update VoiceUserSettingsTab.tsx * Make tests use new defaults (enable element call) * Default events power levels * format * review "Enable Legacy voice/video calls" label * more radical usage of defaults in element_call config.json's * Update config.json * Update en_EN.json * Update RoomSettingsDialog-test.tsx.snap * Update useRoomCall.tsx * fix imports * Update request permission promp to latest designs: https://www.figma.com/design/aOEkaJtaBmPy058V7uoqVr/Element-Call-Updates---2026?node-id=45-12591&t=7takL39icZwt9YjL-0 * Update config.json.d.ts * fix usage of `Element` in i18n * Update General-room-settings-tab-should-be-rendered-properly-1-linux.png --------- Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
@@ -36,10 +36,29 @@ import createRoom, {
|
||||
canEncryptToAllUsers,
|
||||
waitForRoomEncryption,
|
||||
} from "../../src/createRoom";
|
||||
import SettingsStore from "../../src/settings/SettingsStore";
|
||||
import { ElementCallMemberEventType } from "../../src/call-types";
|
||||
import DMRoomMap from "../../src/utils/DMRoomMap";
|
||||
import { PreferredRoomVersions } from "../../src/utils/PreferredRoomVersions";
|
||||
import SdkConfig from "../../src/SdkConfig";
|
||||
|
||||
/**
|
||||
* This should be the same as
|
||||
* { POWER_LEVEL_EVENTS_DEFAULT, [ElementCallMemberEventType.name]: 0 }
|
||||
* to get the most regression coverage we provide the string based snapshot here.
|
||||
*/
|
||||
const POWER_LEVELS_WITH_CALL_MEMBER = {
|
||||
// Default events power levels we always expect
|
||||
"m.room.avatar": 50,
|
||||
"m.room.canonical_alias": 50,
|
||||
"m.room.encryption": 100,
|
||||
"m.room.history_visibility": 100,
|
||||
"m.room.name": 50,
|
||||
"m.room.power_levels": 100,
|
||||
"m.room.server_acl": 100,
|
||||
"m.room.tombstone": 100,
|
||||
// Custom rtc.member event we expect to be 0
|
||||
[ElementCallMemberEventType.name]: 0,
|
||||
};
|
||||
|
||||
describe("createRoom", () => {
|
||||
mockPlatformPeg();
|
||||
@@ -51,7 +70,10 @@ describe("createRoom", () => {
|
||||
DMRoomMap.makeShared(client);
|
||||
});
|
||||
|
||||
afterEach(() => jest.clearAllMocks());
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
SdkConfig.reset();
|
||||
});
|
||||
|
||||
it("creates a private room", async () => {
|
||||
await createRoom(client, { createOpts: { preset: Preset.PrivateChat } });
|
||||
@@ -63,6 +85,7 @@ describe("createRoom", () => {
|
||||
{ state_key: "", type: "m.room.guest_access", content: { guest_access: "can_join" } },
|
||||
{ type: "m.room.history_visibility", content: { history_visibility: "invited" } },
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -83,6 +106,7 @@ describe("createRoom", () => {
|
||||
},
|
||||
{ type: "m.room.history_visibility", content: { history_visibility: "invited" } },
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -112,6 +136,7 @@ describe("createRoom", () => {
|
||||
{ type: "m.room.history_visibility", content: { history_visibility: "invited" } },
|
||||
// Room name is NOT included, since it needs to be encrypted.
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
|
||||
// And the room name, topic and avatar are set later
|
||||
@@ -155,6 +180,7 @@ describe("createRoom", () => {
|
||||
{ type: "m.room.history_visibility", content: { history_visibility: "invited" } },
|
||||
// Room name is NOT included, since it needs to be encrypted.
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
|
||||
// And the avatar is set later
|
||||
@@ -188,6 +214,7 @@ describe("createRoom", () => {
|
||||
{ type: "m.room.history_visibility", content: { history_visibility: "invited" } },
|
||||
// Room name is NOT included, since it needs to be encrypted.
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
|
||||
// And the room name, topic and avatar were not set since we didn't
|
||||
@@ -228,6 +255,7 @@ describe("createRoom", () => {
|
||||
{ type: "m.space.parent", state_key: parentSpace.roomId, content: { canonical: true, via: [] } },
|
||||
{ type: "m.room.history_visibility", content: { history_visibility: "invited" } },
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -238,6 +266,7 @@ describe("createRoom", () => {
|
||||
preset: "public_chat",
|
||||
visibility: "private",
|
||||
initial_state: [{ state_key: "", type: "m.room.guest_access", content: { guest_access: "can_join" } }],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -249,6 +278,7 @@ describe("createRoom", () => {
|
||||
visibility: "private",
|
||||
topic: "My topic",
|
||||
initial_state: [{ state_key: "", type: "m.room.guest_access", content: { guest_access: "can_join" } }],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -266,6 +296,7 @@ describe("createRoom", () => {
|
||||
{ state_key: "", type: "m.room.guest_access", content: { guest_access: "can_join" } },
|
||||
{ type: "m.space.parent", state_key: parentSpace.roomId, content: { canonical: true, via: [] } },
|
||||
],
|
||||
power_level_content_override: { events: POWER_LEVELS_WITH_CALL_MEMBER },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -324,10 +355,6 @@ describe("createRoom", () => {
|
||||
});
|
||||
|
||||
it("correctly sets up MSC3401 power levels", async () => {
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((name: string): any => {
|
||||
if (name === "feature_group_calls") return true;
|
||||
});
|
||||
|
||||
await createRoom(client, {});
|
||||
|
||||
const callMemberPower =
|
||||
|
||||
Reference in New Issue
Block a user