Second batch: remove deprecated calls on MatrixClient ()

* Replace `MatrixClient.forceDiscardSession` call by `MatrixClient.CryptoApi.forceDiscardSession`

* Remove `MatrixClient.scheduleAllGroupSessionsForBackup` mock
This commit is contained in:
Florian Duros 2024-10-18 09:51:53 +02:00 committed by GitHub
parent e79916454f
commit 85d2bf3a04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View file

@ -727,7 +727,7 @@ export const Commands = [
isEnabled: (cli) => !isCurrentLocalRoom(cli), isEnabled: (cli) => !isCurrentLocalRoom(cli),
runFn: function (cli, roomId) { runFn: function (cli, roomId) {
try { try {
cli.forceDiscardSession(roomId); cli.getCrypto()?.forceDiscardSession(roomId);
} catch (e) { } catch (e) {
return reject(e instanceof Error ? e.message : e); return reject(e instanceof Error ? e.message : e);
} }

View file

@ -166,7 +166,6 @@ export function createTestClient(): MatrixClient {
}); });
}), }),
mxcUrlToHttp: jest.fn().mockImplementation((mxc: string) => `http://this.is.a.url/${mxc.substring(6)}`), mxcUrlToHttp: jest.fn().mockImplementation((mxc: string) => `http://this.is.a.url/${mxc.substring(6)}`),
scheduleAllGroupSessionsForBackup: jest.fn().mockResolvedValue(undefined),
setAccountData: jest.fn(), setAccountData: jest.fn(),
setRoomAccountData: jest.fn(), setRoomAccountData: jest.fn(),
setRoomTopic: jest.fn(), setRoomTopic: jest.fn(),