From 8a06663023019003b23c839bbb80ef5f64fe329a Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:55:41 +0200 Subject: [PATCH] load all call members for now at startup later on we can be smarter and load then once you interact with the call --- src/matrix/calls/CallHandler.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/matrix/calls/CallHandler.ts b/src/matrix/calls/CallHandler.ts index f60c1fe6..43fbcdb7 100644 --- a/src/matrix/calls/CallHandler.ts +++ b/src/matrix/calls/CallHandler.ts @@ -97,9 +97,13 @@ export class CallHandler { })); const roomIds = Array.from(new Set(callEntries.map(e => e.roomId))); await Promise.all(roomIds.map(async roomId => { - const ownCallsMemberEvent = await txn.roomState.get(roomId, EventType.GroupCallMember, this.options.ownUserId); - if (ownCallsMemberEvent) { - this.handleCallMemberEvent(ownCallsMemberEvent.event, log); + // const ownCallsMemberEvent = await txn.roomState.get(roomId, EventType.GroupCallMember, this.options.ownUserId); + // if (ownCallsMemberEvent) { + // this.handleCallMemberEvent(ownCallsMemberEvent.event, log); + // } + const callsMemberEvents = await txn.roomState.getAllForType(roomId, EventType.GroupCallMember); + for (const entry of callsMemberEvents) { + this.handleCallMemberEvent(entry.event, log); } // TODO: we should be loading the other members as well at some point }));