Show & clear your own on-a-call status (#34613)

* Show & clear your own on-a-call status

The user menu / settings now reflects your own on-a-call status
and pressing the 'clear' button will clear both m.status and m.call,
whichever are set.

* Update function name

* Fix tests

And make the clear status function simpler by just throwing if either fails.

* Fix more tests
This commit is contained in:
David Baker
2026-08-10 14:13:42 +00:00
committed by GitHub
parent 0b264a482e
commit fef1f0e0dd
8 changed files with 54 additions and 17 deletions
@@ -32,6 +32,7 @@ describe("UserMenuViewModel", () => {
...mockClientMethodsUser(),
...mockClientMethodsServer(),
getAuthMetadata: jest.fn().mockRejectedValue(new MatrixError({ errcode: "M_UNRECOGNIZED" }, 404)),
getExtendedProfileProperty: jest.fn().mockResolvedValue(undefined),
setExtendedProfileProperty: jest.fn().mockResolvedValue(undefined),
});
sdkContext = new TestSDKContext();
@@ -178,6 +179,7 @@ describe("UserMenuViewModel", () => {
});
it("can clear a user status", async () => {
client.getExtendedProfileProperty.mockResolvedValue({ emoji: "🧪", text: "Testing" });
const vm = new UserMenuViewModel({ ownProfileStore: mockOwnProfileStore }, dispatcher, client, true);
vm.setOpen(true);
vm.clearStatus();