Skip to content

Commit 7d2f4cf

Browse files
Send call version 1 as a string (matrix-org#2471)
1 parent 5822730 commit 7d2f4cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/webrtc/call.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export enum CallErrorCode {
218218
/**
219219
* The version field that we set in m.call.* events
220220
*/
221-
const VOIP_PROTO_VERSION = 1;
221+
const VOIP_PROTO_VERSION = "1";
222222

223223
/** The fallback ICE server to use for STUN or TURN protocols. */
224224
const FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';
@@ -909,7 +909,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
909909
if (this.state === CallState.WaitLocalMedia) return;
910910
const content = {};
911911
// Don't send UserHangup reason to older clients
912-
if ((this.opponentVersion && this.opponentVersion >= 1) || reason !== CallErrorCode.UserHangup) {
912+
if ((this.opponentVersion && this.opponentVersion !== 0) || reason !== CallErrorCode.UserHangup) {
913913
content["reason"] = reason;
914914
}
915915
this.sendVoipEvent(EventType.CallHangup, content);
@@ -925,7 +925,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
925925
throw Error("Call must be in 'ringing' state to reject!");
926926
}
927927

928-
if (this.opponentVersion < 1) {
928+
if (this.opponentVersion === 0) {
929929
logger.info(
930930
`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`,
931931
);

0 commit comments

Comments
 (0)