From f76cb677ff5a2bf546e547fe8749c2b49dfdacda Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 13 Feb 2020 14:31:03 +0100 Subject: [PATCH] store sasEvent on verifier so we can get it if we missed show_sas event --- src/crypto/verification/SAS.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/crypto/verification/SAS.js b/src/crypto/verification/SAS.js index 367ee1463..3a7f61e54 100644 --- a/src/crypto/verification/SAS.js +++ b/src/crypto/verification/SAS.js @@ -306,7 +306,7 @@ export class SAS extends Base { + this._channel.transactionId; const sasBytes = olmSAS.generate_bytes(sasInfo, 6); const verifySAS = new Promise((resolve, reject) => { - this.emit("show_sas", { + this.sasEvent = { sas: generateSas(sasBytes, sasMethods), confirm: () => { this._sendMAC(olmSAS, macMethod); @@ -314,7 +314,8 @@ export class SAS extends Base { }, cancel: () => reject(newUserCancelledError()), mismatch: () => reject(newMismatchedSASError()), - }); + }; + this.emit("show_sas", this.sasEvent); }); @@ -390,7 +391,7 @@ export class SAS extends Base { + this._channel.transactionId; const sasBytes = olmSAS.generate_bytes(sasInfo, 6); const verifySAS = new Promise((resolve, reject) => { - this.emit("show_sas", { + this.sasEvent = { sas: generateSas(sasBytes, sasMethods), confirm: () => { this._sendMAC(olmSAS, macMethod); @@ -398,7 +399,8 @@ export class SAS extends Base { }, cancel: () => reject(newUserCancelledError()), mismatch: () => reject(newMismatchedSASError()), - }); + }; + this.emit("show_sas", this.sasEvent); });