Merge pull request #4044 from matrix-org/bwindels/riotx-qr-compat

Make QR self-verification compatible with RiotX
This commit is contained in:
Bruno Windels 2020-02-11 17:20:40 +00:00 committed by GitHub
commit 91c9c00712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View file

@ -27,7 +27,7 @@ import {verificationMethods} from 'matrix-js-sdk/src/crypto';
import {ensureDMExists} from "../../../createRoom";
import dis from "../../../dispatcher";
import SettingsStore from '../../../settings/SettingsStore';
import {SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode";
import {SCAN_QR_CODE_METHOD, SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode";
import VerificationQREmojiOptions from "../verification/VerificationQREmojiOptions";
const MODE_LEGACY = 'legacy';
@ -135,6 +135,8 @@ export default class DeviceVerifyDialog extends React.Component {
this._request = await client.requestVerification(this.props.userId, [
verificationMethods.SAS,
SHOW_QR_CODE_METHOD,
SCAN_QR_CODE_METHOD,
verificationMethods.RECIPROCATE_QR_CODE,
]);
await this._request.waitFor(r => r.ready || r.started);

View file

@ -24,7 +24,7 @@ import BaseDialog from './BaseDialog';
import DialogButtons from '../elements/DialogButtons';
import {verificationMethods} from 'matrix-js-sdk/src/crypto';
import {MatrixClientPeg} from "../../../MatrixClientPeg";
import {SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode";
import {SCAN_QR_CODE_METHOD, SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode";
@replaceableComponent("views.dialogs.NewSessionReviewDialog")
export default class NewSessionReviewDialog extends React.PureComponent {
@ -43,12 +43,16 @@ export default class NewSessionReviewDialog extends React.PureComponent {
const cli = MatrixClientPeg.get();
const request = await cli.requestVerification(
userId,
[verificationMethods.SAS, SHOW_QR_CODE_METHOD],
[
verificationMethods.SAS,
SHOW_QR_CODE_METHOD,
SCAN_QR_CODE_METHOD,
verificationMethods.RECIPROCATE_QR_CODE,
],
[device.deviceId],
);
this.props.onFinished(true);
Modal.createTrackedDialog('New Session Verification', 'Starting dialog', VerificationRequestDialog, {
verificationRequest: request,
});

View file

@ -1,5 +1,5 @@
/*
Copyright 2019, 2020 The Matrix.org Foundation C.I.C.
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.