1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Terminate calls once we've replaced them

This commit is contained in:
David Baker
2021-03-26 13:52:23 +00:00
parent 34bb05bd88
commit 9ecc0f5d95

View File

@@ -1547,7 +1547,9 @@ export class MatrixCall extends EventEmitter {
create_call: replacementId,
} as MCallReplacesEvent;
return this.sendVoipEvent(EventType.CallReplaces, body);
await this.sendVoipEvent(EventType.CallReplaces, body);
await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);
}
/*
@@ -1585,6 +1587,8 @@ export class MatrixCall extends EventEmitter {
} as MCallReplacesEvent;
await this.sendVoipEvent(EventType.CallReplaces, bodyToTransferee);
await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);
}
private async terminate(hangupParty: CallParty, hangupReason: CallErrorCode, shouldEmit: boolean) {