From 6553e331cddfb29cfd953c82ca6c5fa04544576a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 27 Mar 2020 12:04:48 +0100 Subject: [PATCH 1/2] also send .done event for to_device verification --- src/crypto/verification/request/InRoomChannel.js | 5 ----- src/crypto/verification/request/ToDeviceChannel.js | 4 ---- src/crypto/verification/request/VerificationRequest.js | 7 +++---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/crypto/verification/request/InRoomChannel.js b/src/crypto/verification/request/InRoomChannel.js index 916847ac7..19b49fd75 100644 --- a/src/crypto/verification/request/InRoomChannel.js +++ b/src/crypto/verification/request/InRoomChannel.js @@ -44,11 +44,6 @@ export class InRoomChannel { this._requestEventId = null; } - /** Whether this channel needs m.key.verification.done messages to be sent after a successful verification */ - get needsDoneMessage() { - return true; - } - get receiveStartFromOtherDevices() { return true; } diff --git a/src/crypto/verification/request/ToDeviceChannel.js b/src/crypto/verification/request/ToDeviceChannel.js index 5f0a13194..ea47fe5e8 100644 --- a/src/crypto/verification/request/ToDeviceChannel.js +++ b/src/crypto/verification/request/ToDeviceChannel.js @@ -61,10 +61,6 @@ export class ToDeviceChannel { return this._deviceId; } - get needsDoneMessage() { - return false; - } - static getEventType(event) { return event.getType(); } diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js index 429e448b1..986de6df1 100644 --- a/src/crypto/verification/request/VerificationRequest.js +++ b/src/crypto/verification/request/VerificationRequest.js @@ -819,11 +819,10 @@ export class VerificationRequest extends EventEmitter { } onVerifierFinished() { - if (this.channel.needsDoneMessage) { - // verification in DM requires a done message - this.channel.send("m.key.verification.done", {}); - } + // verification in DM requires a done message + this.channel.send("m.key.verification.done", {}); this._verifierHasFinished = true; + // move to .done phase const newTransitions = this._applyPhaseTransitions(); if (newTransitions.length) { this._setPhase(newTransitions[newTransitions.length - 1].phase); From 4f0a297cf3ae98cd499e28f62493b2fe55341a61 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 27 Mar 2020 12:08:43 +0100 Subject: [PATCH 2/2] remove obsolete comment --- src/crypto/verification/request/VerificationRequest.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js index 986de6df1..87442613a 100644 --- a/src/crypto/verification/request/VerificationRequest.js +++ b/src/crypto/verification/request/VerificationRequest.js @@ -819,7 +819,6 @@ export class VerificationRequest extends EventEmitter { } onVerifierFinished() { - // verification in DM requires a done message this.channel.send("m.key.verification.done", {}); this._verifierHasFinished = true; // move to .done phase