First batch: remove deprecated calls on MatrixClient (#28207)
* Remove `initCrypto` mocking * Remove `MatrixClient.downloadKeys` mocking * Remove `MatrixClient.getStoredDevice` mocking * Replace `MatrixClient.setGlobalBlacklistUnverifiedDevices` by `MatrixClient.CryptoApi.globalBlacklistUnverifiedDevices` * Remove `MatrixClient.getStoredCrossSigningForUser` mocking * Replace `MatrixClient.legacyDeviceVerification` by `MatrixClient.CryptoApi.requestDeviceVerification` * Remove `MatrixClient.isCrossSigningReady` mock * Replace `MatrixClient.bootstrapCrossSigning` by `MatrixClient.getCrypto.bootstrapCrossSigning` * Replace `MatrixClient.getCryptoTrustCrossSignedDevices` by `MatrixClient.getCrypto.getTrustCrossSignedDevices` * Replace `MatrixClient.hasSecretStorageKey` by `MatrixClient.SecretStorage.hasKey` * Replace `MatrixClient.getDefaultSecretStorageKeyId` by `MatrixClient.SecretStorage.getDefaultKeyId` * Remove `MatrixClient.encryptAndSendToDevices` call
This commit is contained in:
+4
-7
@@ -7,7 +7,6 @@ Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { User, MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix";
|
||||
import { VerificationMethod } from "matrix-js-sdk/src/types";
|
||||
import { CrossSigningKey, VerificationRequest } from "matrix-js-sdk/src/crypto-api";
|
||||
|
||||
import dis from "./dispatcher/dispatcher";
|
||||
@@ -39,7 +38,7 @@ export async function verifyDevice(matrixClient: MatrixClient, user: User, devic
|
||||
return;
|
||||
}
|
||||
// if cross-signing is not explicitly disabled, check if it should be enabled first.
|
||||
if (matrixClient.getCryptoTrustCrossSignedDevices()) {
|
||||
if (matrixClient.getCrypto()?.getTrustCrossSignedDevices()) {
|
||||
if (!(await enable4SIfNeeded(matrixClient))) {
|
||||
return;
|
||||
}
|
||||
@@ -50,11 +49,9 @@ export async function verifyDevice(matrixClient: MatrixClient, user: User, devic
|
||||
device,
|
||||
onFinished: async (action): Promise<void> => {
|
||||
if (action === "sas") {
|
||||
const verificationRequestPromise = matrixClient.legacyDeviceVerification(
|
||||
user.userId,
|
||||
device.deviceId,
|
||||
VerificationMethod.Sas,
|
||||
);
|
||||
const verificationRequestPromise = matrixClient
|
||||
.getCrypto()
|
||||
?.requestDeviceVerification(user.userId, device.deviceId);
|
||||
setRightPanel({ member: user, verificationRequestPromise });
|
||||
} else if (action === "legacy") {
|
||||
Modal.createDialog(ManualDeviceKeyVerificationDialog, {
|
||||
|
||||
Reference in New Issue
Block a user