From bb3e082e5b2dff9429dc1f672dd2cc97bc9e5729 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 1 Oct 2020 10:15:27 +0100 Subject: [PATCH] Make direction public, remove didConnect Various flags that may or may not have been part of the poorly defined external API before. Neither were used internally. Make direction a public export but remove didConnect. --- src/webrtc/call.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index d8ae5fa19..74086e882 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -75,8 +75,8 @@ enum CallType { } enum CallDirection { - INBOUND, - OUTBOUND, + INBOUND = 'inbound', + OUTBOUND = 'outbound', } enum CallParty { @@ -147,12 +147,11 @@ export class MatrixCall extends EventEmitter { state: CallState; hangupParty: CallParty; hangupReason: string; + direction: CallDirection; private client: any; // Fix when client is TSified - private direction: CallDirection; private forceTURN: boolean; private turnServers: Array; - private didConnect: boolean; private candidateSendQueue: Array; private candidateSendTries: number; private mediaPromises: { [queueId: string]: Promise; }; @@ -192,7 +191,6 @@ export class MatrixCall extends EventEmitter { this.callId = "c" + new Date().getTime() + Math.random(); this.state = CallState.FLEDGLING; - this.didConnect = false; // A queue for candidates waiting to go out. // We try to amalgamate candidates into a single candidate message where @@ -928,7 +926,6 @@ export class MatrixCall extends EventEmitter { if (this.peerConn.iceConnectionState == 'completed' || this.peerConn.iceConnectionState == 'connected') { this.setState(CallState.CONNECTED); - this.didConnect = true; } else if (this.peerConn.iceConnectionState == 'failed') { this.hangup('ice_failed', false); }