diff --git a/src/matrix/calls/group/GroupCall.ts b/src/matrix/calls/group/GroupCall.ts index d077f27c..892ed67c 100644 --- a/src/matrix/calls/group/GroupCall.ts +++ b/src/matrix/calls/group/GroupCall.ts @@ -269,7 +269,7 @@ export class GroupCall extends EventEmitter<{change: never}> { if (this._state === GroupCallState.Joined) { log.set("leave_own", true); for (const [,member] of this._members) { - member.disconnect(); + member.disconnect(true); } this._localMedia?.dispose(); this._localMedia = undefined; @@ -286,7 +286,7 @@ export class GroupCall extends EventEmitter<{change: never}> { if (member) { log.set("leave", true); this._members.remove(memberKey); - member.disconnect(); + member.disconnect(false); } this.emitChange(); }); diff --git a/src/matrix/calls/group/Member.ts b/src/matrix/calls/group/Member.ts index 1305fcf1..06693030 100644 --- a/src/matrix/calls/group/Member.ts +++ b/src/matrix/calls/group/Member.ts @@ -99,9 +99,13 @@ export class Member { } /** @internal */ - disconnect() { + disconnect(hangup: boolean) { this.logItem.wrap("disconnect", log => { - this.peerCall?.close(undefined, log); + if (hangup) { + this.peerCall?.hangup(CallErrorCode.UserHangup); + } else { + this.peerCall?.close(undefined, log); + } this.peerCall?.dispose(); this.peerCall = undefined; this.localMedia?.dispose();