From 37558ac1b487ec689c3820baaf76bdf962d58e4e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 4 Nov 2019 14:38:24 +0100 Subject: [PATCH] detect other end cancelling and reject main promise --- src/crypto/verification/Base.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/crypto/verification/Base.js b/src/crypto/verification/Base.js index 8275cfa1b..c764f68aa 100644 --- a/src/crypto/verification/Base.js +++ b/src/crypto/verification/Base.js @@ -151,6 +151,10 @@ export default class VerificationBase extends EventEmitter { this._rejectEvent = undefined; this._resetTimer(); this._resolveEvent(e); + } else if (e.getType() === "m.key.verification.cancel") { + const reject = this._reject; + this._reject = undefined; + reject(new Error("Other side cancelled verification")); } else { const exception = new Error( "Unexpected message: expecting " + this._expectedEvent