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

Send hangup reason if the opponent supports it

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-07-30 08:53:18 +02:00
parent a69d9a9f20
commit b15ba8c5e3

View File

@@ -734,9 +734,10 @@ export class MatrixCall extends EventEmitter {
// We don't want to send hangup here if we didn't even get to sending an invite // We don't want to send hangup here if we didn't even get to sending an invite
if (this.state === CallState.WaitLocalMedia) return; if (this.state === CallState.WaitLocalMedia) return;
const content = {}; const content = {};
// Continue to send no reason for user hangups temporarily, until // Don't send UserHangup reason to older clients
// clients understand the user_hangup reason (voip v1) if ((this.opponentVersion && this.opponentVersion >= 1) || reason !== CallErrorCode.UserHangup) {
if (reason !== CallErrorCode.UserHangup) content['reason'] = reason; content["reason"] = reason;
}
this.sendVoipEvent(EventType.CallHangup, content); this.sendVoipEvent(EventType.CallHangup, content);
} }