load all call members for now at startup

later on we can be smarter and load then once you interact with the call
This commit is contained in:
Bruno Windels 2022-04-07 16:55:41 +02:00
parent ad140d5af1
commit 8a06663023

View file

@ -97,9 +97,13 @@ export class CallHandler {
})); }));
const roomIds = Array.from(new Set(callEntries.map(e => e.roomId))); const roomIds = Array.from(new Set(callEntries.map(e => e.roomId)));
await Promise.all(roomIds.map(async roomId => { await Promise.all(roomIds.map(async roomId => {
const ownCallsMemberEvent = await txn.roomState.get(roomId, EventType.GroupCallMember, this.options.ownUserId); // const ownCallsMemberEvent = await txn.roomState.get(roomId, EventType.GroupCallMember, this.options.ownUserId);
if (ownCallsMemberEvent) { // if (ownCallsMemberEvent) {
this.handleCallMemberEvent(ownCallsMemberEvent.event, log); // 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 // TODO: we should be loading the other members as well at some point
})); }));