Properly handle multiple rooms

This commit is contained in:
Robert Long 2021-07-30 13:58:15 -07:00
parent ade6c19eba
commit e98abaff4d

View File

@ -172,6 +172,10 @@ export class ConferenceCallManager extends EventEmitter {
.forEach((member) => this._processMember(member.userId));
for (const { call, onHangup, onReplaced } of this.pendingCalls) {
if (call.roomId !== roomId) {
continue;
}
call.removeListener("hangup", onHangup);
call.removeListener("replaced", onReplaced);
const userId = call.opponentMember.userId;
@ -237,6 +241,10 @@ export class ConferenceCallManager extends EventEmitter {
};
_onMemberChanged = (_event, _state, member) => {
if (member.roomId !== this.roomId) {
return;
}
this._processMember(member.userId);
};
@ -320,6 +328,10 @@ export class ConferenceCallManager extends EventEmitter {
return;
}
if (call.roomId !== this.roomId) {
return;
}
const userId = call.opponentMember.userId;
this._addCall(call, userId);
this._setDebugState(userId, "answered");