diff --git a/src/matrix/verification/SAS/stages/SendDoneStage.ts b/src/matrix/verification/SAS/stages/SendDoneStage.ts index 95167e24..dcdeba3a 100644 --- a/src/matrix/verification/SAS/stages/SendDoneStage.ts +++ b/src/matrix/verification/SAS/stages/SendDoneStage.ts @@ -19,8 +19,9 @@ import {VerificationEventType} from "../channel/types"; export class SendDoneStage extends BaseSASVerificationStage { async completeStage() { await this.log.wrap("SendDoneStage.completeStage", async (log) => { - this.eventEmitter.emit("VerificationCompleted", this.otherUserDeviceId); await this.channel.send(VerificationEventType.Done, {}, log); + await this.channel.waitForEvent(VerificationEventType.Done); + this.eventEmitter.emit("VerificationCompleted", this.otherUserDeviceId); }); } } diff --git a/src/matrix/verification/SAS/stages/VerifyMacStage.ts b/src/matrix/verification/SAS/stages/VerifyMacStage.ts index 7fa66cc5..a1ef5515 100644 --- a/src/matrix/verification/SAS/stages/VerifyMacStage.ts +++ b/src/matrix/verification/SAS/stages/VerifyMacStage.ts @@ -30,7 +30,6 @@ export class VerifyMacStage extends BaseSASVerificationStage { const macMethod = acceptMessage.message_authentication_code; const calculateMAC = createCalculateMAC(this.olmSAS, macMethod); await this.checkMAC(calculateMAC, log); - await this.channel.waitForEvent(VerificationEventType.Done); this.setNextStage(new SendDoneStage(this.options)); }); }