From 85d2bf3a04faa5826b56136f0f44dce3cebb48c4 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Fri, 18 Oct 2024 09:51:53 +0200 Subject: [PATCH] Second batch: remove deprecated calls on `MatrixClient` (#28227) * Replace `MatrixClient.forceDiscardSession` call by `MatrixClient.CryptoApi.forceDiscardSession` * Remove `MatrixClient.scheduleAllGroupSessionsForBackup` mock --- src/SlashCommands.tsx | 2 +- test/test-utils/test-utils.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 7375cba568..02c2b33849 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -727,7 +727,7 @@ export const Commands = [ isEnabled: (cli) => !isCurrentLocalRoom(cli), runFn: function (cli, roomId) { try { - cli.forceDiscardSession(roomId); + cli.getCrypto()?.forceDiscardSession(roomId); } catch (e) { return reject(e instanceof Error ? e.message : e); } diff --git a/test/test-utils/test-utils.ts b/test/test-utils/test-utils.ts index d9f4f3f5a6..dd1f47ad6d 100644 --- a/test/test-utils/test-utils.ts +++ b/test/test-utils/test-utils.ts @@ -166,7 +166,6 @@ export function createTestClient(): MatrixClient { }); }), mxcUrlToHttp: jest.fn().mockImplementation((mxc: string) => `http://this.is.a.url/${mxc.substring(6)}`), - scheduleAllGroupSessionsForBackup: jest.fn().mockResolvedValue(undefined), setAccountData: jest.fn(), setRoomAccountData: jest.fn(), setRoomTopic: jest.fn(),