Send done before waiting for message

This commit is contained in:
RMidhunSuresh 2023-03-31 15:54:45 +05:30
parent 515bd24cfb
commit 016f9ff300
2 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,9 @@ import {VerificationEventType} from "../channel/types";
export class SendDoneStage extends BaseSASVerificationStage { export class SendDoneStage extends BaseSASVerificationStage {
async completeStage() { async completeStage() {
await this.log.wrap("SendDoneStage.completeStage", async (log) => { await this.log.wrap("SendDoneStage.completeStage", async (log) => {
this.eventEmitter.emit("VerificationCompleted", this.otherUserDeviceId);
await this.channel.send(VerificationEventType.Done, {}, log); await this.channel.send(VerificationEventType.Done, {}, log);
await this.channel.waitForEvent(VerificationEventType.Done);
this.eventEmitter.emit("VerificationCompleted", this.otherUserDeviceId);
}); });
} }
} }

View File

@ -30,7 +30,6 @@ export class VerifyMacStage extends BaseSASVerificationStage {
const macMethod = acceptMessage.message_authentication_code; const macMethod = acceptMessage.message_authentication_code;
const calculateMAC = createCalculateMAC(this.olmSAS, macMethod); const calculateMAC = createCalculateMAC(this.olmSAS, macMethod);
await this.checkMAC(calculateMAC, log); await this.checkMAC(calculateMAC, log);
await this.channel.waitForEvent(VerificationEventType.Done);
this.setNextStage(new SendDoneStage(this.options)); this.setNextStage(new SendDoneStage(this.options));
}); });
} }