Base stage class does not need disposable

This commit is contained in:
RMidhunSuresh 2023-03-14 14:28:33 +05:30
parent 806e672806
commit dedf64d011
No known key found for this signature in database
10 changed files with 1 additions and 11 deletions

View File

@ -43,7 +43,7 @@ export type Options = {
eventEmitter: EventEmitter<SASProgressEvents>
}
export abstract class BaseSASVerificationStage extends Disposables {
export abstract class BaseSASVerificationStage {
protected ourUser: UserData;
protected otherUserId: string;
protected log: ILogItem;
@ -60,7 +60,6 @@ export abstract class BaseSASVerificationStage extends Disposables {
protected eventEmitter: EventEmitter<SASProgressEvents>;
constructor(options: Options) {
super();
this.options = options;
this.ourUser = options.ourUser;
this.otherUserId = options.otherUserId;

View File

@ -90,7 +90,6 @@ export class CalculateSASStage extends BaseSASVerificationStage {
const emoji = generateEmojiSas(Array.from(sasBytes));
console.log("Emoji calculated:", emoji);
this.setNextStage(new SendMacStage(this.options));
this.dispose();
});
}

View File

@ -27,7 +27,6 @@ export class RequestVerificationStage extends BaseSASVerificationStage {
await this.channel.send(VerificationEventTypes.Request, content, log);
this.setNextStage(new SelectVerificationMethodStage(this.options));
await this.channel.waitForEvent("m.key.verification.ready");
this.dispose();
});
}
}

View File

@ -53,7 +53,6 @@ export class SelectVerificationMethodStage extends BaseSASVerificationStage {
// We need to send the accept message next
this.setNextStage(new SendAcceptVerificationStage(this.options));
}
this.dispose();
});
}

View File

@ -48,7 +48,6 @@ export class SendAcceptVerificationStage extends BaseSASVerificationStage {
await this.channel.send(VerificationEventTypes.Accept, contentToSend, log);
await this.channel.waitForEvent(VerificationEventTypes.Key);
this.setNextStage(new SendKeyStage(this.options));
this.dispose();
});
}
}

View File

@ -20,7 +20,6 @@ export class SendDoneStage extends BaseSASVerificationStage {
async completeStage() {
await this.log.wrap("VerifyMacStage.completeStage", async (log) => {
await this.channel.send(VerificationEventTypes.Done, {}, log);
this.dispose();
});
}
}

View File

@ -30,7 +30,6 @@ export class SendKeyStage extends BaseSASVerificationStage {
*/
await this.channel.waitForEvent(VerificationEventTypes.Key);
this.setNextStage(new CalculateSASStage(this.options));
this.dispose();
});
}
}

View File

@ -38,7 +38,6 @@ export class SendMacStage extends BaseSASVerificationStage {
await this.sendMAC(log);
await this.channel.waitForEvent(VerificationEventTypes.Mac);
this.setNextStage(new VerifyMacStage(this.options));
this.dispose();
});
}

View File

@ -26,7 +26,6 @@ export class SendReadyStage extends BaseSASVerificationStage {
};
await this.channel.send(VerificationEventTypes.Ready, content, log);
this.setNextStage(new SelectVerificationMethodStage(this.options));
this.dispose();
});
}
}

View File

@ -40,7 +40,6 @@ export class VerifyMacStage extends BaseSASVerificationStage {
await this.checkMAC(log);
await this.channel.waitForEvent(VerificationEventTypes.Done);
this.setNextStage(new SendDoneStage(this.options));
this.dispose();
});
}