Set Element Call "intents" when starting and answering DM calls. (#30730)

* Start to implement intents for DM calls.

* Refactor and fix intent bugs

* Do not default skipLobby in Element Web

* Remove hacks

* cleanup

* Don't template skipLobby or returnToLobby but inject as required

* Revert "Don't template skipLobby or returnToLobby but inject as required"

This reverts commit 35569f35bb254462dd86c16438dab38188db6fbc.

* lint

* Fix test

* lint

* Use other intents

* Ensure we test all intents

* lint

* cleanup

* Fix room check

* Update imports

* update test

* Fix RoomViewStore test
This commit is contained in:
Will Hunt
2025-09-12 14:00:48 +01:00
committed by GitHub
parent 33d3df24f9
commit 1e0cdf7b14
3 changed files with 105 additions and 36 deletions

View File

@@ -44,6 +44,7 @@ import { CallStore } from "../../../src/stores/CallStore";
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
import MediaDeviceHandler, { MediaDeviceKindEnum } from "../../../src/MediaDeviceHandler";
import { storeRoomAliasInCache } from "../../../src/RoomAliasCache.ts";
import { type Call } from "../../../src/models/Call.ts";
jest.mock("../../../src/Modal");
@@ -361,8 +362,12 @@ describe("RoomViewStore", function () {
});
it("when viewing a call without a broadcast, it should not raise an error", async () => {
const call = { presented: false } as Call;
const getCallSpy = jest.spyOn(CallStore.instance, "getCall").mockReturnValue(call);
await setupAsyncStoreWithClient(CallStore.instance, MatrixClientPeg.safeGet());
await viewCall();
expect(getCallSpy).toHaveBeenCalledWith(roomId);
expect(call.presented).toEqual(true);
});
it("should display an error message when the room is unreachable via the roomId", async () => {