From a1844e44f2b9166c3212e12c2fab5660a51ccfc5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 11 Feb 2020 17:44:41 +0100 Subject: [PATCH 1/2] remove methods arg to requestVerification(DM) as it's easy to have this argument be out of sync from all the places this is called from the js-sdk. There is also little point, as you can already specify the methods a consumer of the js-sdk wants to provide through the verificationMethods option when creating the client object. --- src/components/views/dialogs/DeviceVerifyDialog.js | 2 +- src/components/views/dialogs/NewSessionReviewDialog.js | 6 ------ src/components/views/right_panel/UserInfo.js | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index f8d66ae641..835b7daf02 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -123,7 +123,7 @@ export default class DeviceVerifyDialog extends React.Component { const roomId = await ensureDMExistsAndOpen(this.props.userId); // throws upon cancellation before having started const request = await client.requestVerificationDM( - this.props.userId, roomId, [verificationMethods.SAS], + this.props.userId, roomId, ); await request.waitFor(r => r.ready || r.started); if (request.ready) { diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index 643a5a3c5d..53e97de9e0 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -43,12 +43,6 @@ 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, - ], [device.deviceId], ); diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index 9db8de1ae3..db73f510a0 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -157,12 +157,6 @@ async function verifyDevice(userId, device) { const cli = MatrixClientPeg.get(); const verificationRequest = await cli.requestVerification( userId, - [ - verificationMethods.SAS, - SHOW_QR_CODE_METHOD, - SCAN_QR_CODE_METHOD, - verificationMethods.RECIPROCATE_QR_CODE, - ], [device.deviceId], ); dis.dispatch({ From 33f3a61b94a48a0ddc9ac7660e51c0861b1edf46 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 11 Feb 2020 17:56:40 +0100 Subject: [PATCH 2/2] remove unused imports --- src/components/views/dialogs/NewSessionReviewDialog.js | 2 -- src/components/views/right_panel/UserInfo.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index 53e97de9e0..0019e0644f 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -22,9 +22,7 @@ import { replaceableComponent } from '../../../utils/replaceableComponent'; import VerificationRequestDialog from './VerificationRequestDialog'; import BaseDialog from './BaseDialog'; import DialogButtons from '../elements/DialogButtons'; -import {verificationMethods} from 'matrix-js-sdk/src/crypto'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; -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 { diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index db73f510a0..315035db96 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -42,8 +42,6 @@ import {textualPowerLevel} from '../../../Roles'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; import EncryptionPanel from "./EncryptionPanel"; -import {verificationMethods} from 'matrix-js-sdk/src/crypto'; -import {SCAN_QR_CODE_METHOD, SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode"; const _disambiguateDevices = (devices) => { const names = Object.create(null);