From 47912fc56c6e1f7bc6c9c42e610114926cc4ea54 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Fri, 2 Feb 2024 14:41:02 +0000 Subject: [PATCH] Impersonate! the identity client. --- src/ConferenceMatrixClient.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ConferenceMatrixClient.ts b/src/ConferenceMatrixClient.ts index 7cb9376..86b406c 100644 --- a/src/ConferenceMatrixClient.ts +++ b/src/ConferenceMatrixClient.ts @@ -12,7 +12,9 @@ export class ConferenceMatrixClient extends MatrixClient { static async create(confConfig: IConfig, storage?: IStorageProvider) { let idClient: IdentityClient|undefined; if (confConfig.idServerDomain) { - idClient = await new MatrixClient(confConfig.homeserverUrl, confConfig.accessToken).getIdentityServerClient(confConfig.idServerDomain); + const client = new MatrixClient(confConfig.homeserverUrl, confConfig.accessToken); + client.impersonateUserId(confConfig.userId); + idClient = await client.getIdentityServerClient(confConfig.idServerDomain); await idClient.acceptAllTerms(); if (confConfig.idServerBrand) { idClient.brand = confConfig.idServerBrand;