From e66549a0671fcec9a9c7b382df5df2af2c99ef48 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 4 Feb 2022 16:40:49 +0530 Subject: [PATCH] Remove dead code --- src/matrix/registration/Registration.ts | 2 +- src/matrix/registration/registrationStageFromType.ts | 5 ++--- src/matrix/registration/stages/BaseRegistrationStage.ts | 6 +----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/matrix/registration/Registration.ts b/src/matrix/registration/Registration.ts index c3b91e3b..ad0b461e 100644 --- a/src/matrix/registration/Registration.ts +++ b/src/matrix/registration/Registration.ts @@ -77,7 +77,7 @@ export class Registration { if (!stageClass) { throw new Error(`Unknown stage: ${stage}`); } - const registrationStage = new stageClass(this._hsApi, this._accountDetails, session, params?.[stage]); + const registrationStage = new stageClass(session, params?.[stage]); if (!firstStage) { firstStage = registrationStage; lastStage = registrationStage; diff --git a/src/matrix/registration/registrationStageFromType.ts b/src/matrix/registration/registrationStageFromType.ts index 6b120a6f..cf08e0ec 100644 --- a/src/matrix/registration/registrationStageFromType.ts +++ b/src/matrix/registration/registrationStageFromType.ts @@ -15,12 +15,11 @@ limitations under the License. */ import type {BaseRegistrationStage} from "./stages/BaseRegistrationStage"; -import type {HomeServerApi} from "../net/HomeServerApi"; -import type {AccountDetails, RegistrationParams} from "./types"; +import type {RegistrationParams} from "./types"; import {DummyAuth} from "./stages/DummyAuth"; import {TermsAuth} from "./stages/TermsAuth"; -type ClassDerivedFromBaseRegistration = { new(hsApi: HomeServerApi, registrationData: AccountDetails, session: string, params?: RegistrationParams): BaseRegistrationStage } & typeof BaseRegistrationStage; +type ClassDerivedFromBaseRegistration = { new(session: string, params?: RegistrationParams): BaseRegistrationStage } & typeof BaseRegistrationStage; export function registrationStageFromType(type: string): ClassDerivedFromBaseRegistration | undefined{ switch (type) { diff --git a/src/matrix/registration/stages/BaseRegistrationStage.ts b/src/matrix/registration/stages/BaseRegistrationStage.ts index 964cc75d..426dbf2c 100644 --- a/src/matrix/registration/stages/BaseRegistrationStage.ts +++ b/src/matrix/registration/stages/BaseRegistrationStage.ts @@ -18,15 +18,11 @@ import type {HomeServerApi} from "../../net/HomeServerApi"; import type {AccountDetails, AuthenticationData, RegistrationParams} from "../types"; export abstract class BaseRegistrationStage { - protected readonly _hsApi: HomeServerApi; - protected readonly _accountDetails: AccountDetails; protected _session: string; protected _nextStage: BaseRegistrationStage; protected readonly _params?: Record - constructor(hsApi: HomeServerApi, accountDetails: AccountDetails, session: string, params?: RegistrationParams) { - this._hsApi = hsApi; - this._accountDetails = accountDetails; + constructor(session: string, params?: RegistrationParams) { this._session = session; this._params = params; }