Remove references to matrix-js-sdk/src/crypto/verification (#12365)
All this stuff is deprecated and has better alternatives now.
This commit is contained in:
committed by
GitHub
parent
ef2bd7ae04
commit
157ca48dff
@@ -29,9 +29,8 @@ import {
|
||||
RoomNameType,
|
||||
TokenRefreshFunction,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { VerificationMethod } from "matrix-js-sdk/src/types";
|
||||
import * as utils from "matrix-js-sdk/src/utils";
|
||||
import { verificationMethods } from "matrix-js-sdk/src/crypto";
|
||||
import { SHOW_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import createMatrixClient from "./utils/createMatrixClient";
|
||||
@@ -433,9 +432,9 @@ class MatrixClientPegClass implements IMatrixClientPeg {
|
||||
// the call arrives.
|
||||
iceCandidatePoolSize: 20,
|
||||
verificationMethods: [
|
||||
verificationMethods.SAS,
|
||||
SHOW_QR_CODE_METHOD,
|
||||
verificationMethods.RECIPROCATE_QR_CODE,
|
||||
VerificationMethod.Sas,
|
||||
VerificationMethod.ShowQrCode,
|
||||
VerificationMethod.Reciprocate,
|
||||
],
|
||||
identityServer: new IdentityAuthClient(),
|
||||
// These are always installed regardless of the labs flag so that cross-signing features
|
||||
|
||||
@@ -15,18 +15,17 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { verificationMethods } from "matrix-js-sdk/src/crypto";
|
||||
import { SCAN_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode";
|
||||
import {
|
||||
ShowQrCodeCallbacks,
|
||||
ShowSasCallbacks,
|
||||
VerificationPhase as Phase,
|
||||
VerificationRequest,
|
||||
VerificationRequestEvent,
|
||||
ShowQrCodeCallbacks,
|
||||
ShowSasCallbacks,
|
||||
VerifierEvent,
|
||||
} from "matrix-js-sdk/src/crypto-api";
|
||||
import { RoomMember, Device, User } from "matrix-js-sdk/src/matrix";
|
||||
import { Device, RoomMember, User } from "matrix-js-sdk/src/matrix";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { VerificationMethod } from "matrix-js-sdk/src/types";
|
||||
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import VerificationQRCode from "../elements/crypto/VerificationQRCode";
|
||||
@@ -87,8 +86,8 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
|
||||
private renderQRPhase(): JSX.Element {
|
||||
const { member, request } = this.props;
|
||||
const showSAS: boolean = request.otherPartySupportsMethod(verificationMethods.SAS);
|
||||
const showQR: boolean = request.otherPartySupportsMethod(SCAN_QR_CODE_METHOD);
|
||||
const showSAS: boolean = request.otherPartySupportsMethod(VerificationMethod.Sas);
|
||||
const showQR: boolean = request.otherPartySupportsMethod(VerificationMethod.ScanQrCode);
|
||||
const brand = SdkConfig.get().brand;
|
||||
|
||||
const noCommonMethodError: JSX.Element | null =
|
||||
@@ -368,9 +367,9 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
return this.renderQRPhase();
|
||||
case Phase.Started:
|
||||
switch (request.chosenMethod) {
|
||||
case verificationMethods.RECIPROCATE_QR_CODE:
|
||||
case VerificationMethod.Reciprocate:
|
||||
return this.renderQRReciprocatePhase();
|
||||
case verificationMethods.SAS: {
|
||||
case VerificationMethod.Sas: {
|
||||
const emojis = this.state.sasEvent ? (
|
||||
<VerificationShowSas
|
||||
displayName={displayName}
|
||||
@@ -400,7 +399,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
|
||||
private startSAS = async (): Promise<void> => {
|
||||
this.setState({ emojiButtonClicked: true });
|
||||
await this.props.request.startVerification(verificationMethods.SAS);
|
||||
await this.props.request.startVerification(VerificationMethod.Sas);
|
||||
};
|
||||
|
||||
private onSasMatchesClick = (): void => {
|
||||
|
||||
@@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { User, MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix";
|
||||
import { verificationMethods as VerificationMethods } from "matrix-js-sdk/src/crypto";
|
||||
import { VerificationMethod } from "matrix-js-sdk/src/types";
|
||||
import { CrossSigningKey, VerificationRequest } from "matrix-js-sdk/src/crypto-api";
|
||||
|
||||
import dis from "./dispatcher/dispatcher";
|
||||
@@ -61,7 +61,7 @@ export async function verifyDevice(matrixClient: MatrixClient, user: User, devic
|
||||
const verificationRequestPromise = matrixClient.legacyDeviceVerification(
|
||||
user.userId,
|
||||
device.deviceId,
|
||||
VerificationMethods.SAS,
|
||||
VerificationMethod.Sas,
|
||||
);
|
||||
setRightPanel({ member: user, verificationRequestPromise });
|
||||
} else if (action === "legacy") {
|
||||
|
||||
Reference in New Issue
Block a user