From afc38b92a0e7050d7c5ab8d4037011ff65e5388c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Jan 2020 11:51:24 +0000 Subject: [PATCH 1/3] Always send scan for RiotX (for now) --- src/components/views/dialogs/DeviceVerifyDialog.js | 3 ++- src/components/views/dialogs/NewSessionReviewDialog.js | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index 7187aa4d28..346af2c2e9 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -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,7 @@ 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, ]); await this._request.waitFor(r => r.ready || r.started); diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index e0f82df0c0..9d12b5c098 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -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,11 @@ 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], [device.deviceId], ); this.props.onFinished(true); - Modal.createTrackedDialog('New Session Verification', 'Starting dialog', VerificationRequestDialog, { verificationRequest: request, }); From ccde5530d26547d5638bcf528e0f36a5dad9ab68 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Jan 2020 12:23:59 +0000 Subject: [PATCH 2/3] Add reciprocate as a method --- src/components/views/dialogs/DeviceVerifyDialog.js | 1 + src/components/views/dialogs/NewSessionReviewDialog.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index 346af2c2e9..f8d66ae641 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -136,6 +136,7 @@ export default class DeviceVerifyDialog extends React.Component { verificationMethods.SAS, SHOW_QR_CODE_METHOD, SCAN_QR_CODE_METHOD, + verificationMethods.RECIPROCATE_QR_CODE, ]); await this._request.waitFor(r => r.ready || r.started); diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index 9d12b5c098..b770cfd881 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -43,7 +43,7 @@ export default class NewSessionReviewDialog extends React.PureComponent { const cli = MatrixClientPeg.get(); const request = await cli.requestVerification( userId, - [verificationMethods.SAS, SHOW_QR_CODE_METHOD, SCAN_QR_CODE_METHOD], + [verificationMethods.SAS, SHOW_QR_CODE_METHOD, SCAN_QR_CODE_METHOD, verificationMethods.RECIPROCATE_QR_CODE], [device.deviceId], ); From 9dde09d36f3f752f083b7b00661faf5d1c993d4a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 31 Jan 2020 14:42:27 +0100 Subject: [PATCH 3/3] cleanup --- src/components/views/dialogs/NewSessionReviewDialog.js | 7 ++++++- src/components/views/dialogs/VerificationRequestDialog.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index b770cfd881..643a5a3c5d 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -43,7 +43,12 @@ export default class NewSessionReviewDialog extends React.PureComponent { const cli = MatrixClientPeg.get(); const request = await cli.requestVerification( userId, - [verificationMethods.SAS, SHOW_QR_CODE_METHOD, SCAN_QR_CODE_METHOD, verificationMethods.RECIPROCATE_QR_CODE], + [ + verificationMethods.SAS, + SHOW_QR_CODE_METHOD, + SCAN_QR_CODE_METHOD, + verificationMethods.RECIPROCATE_QR_CODE, + ], [device.deviceId], ); diff --git a/src/components/views/dialogs/VerificationRequestDialog.js b/src/components/views/dialogs/VerificationRequestDialog.js index baed79bd58..8080fa09f3 100644 --- a/src/components/views/dialogs/VerificationRequestDialog.js +++ b/src/components/views/dialogs/VerificationRequestDialog.js @@ -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.