Skip to content

Commit 719e506

Browse files
author
evgeny-nadymov
committed
Remove TG_CALLS flag
1 parent 96b0f6e commit 719e506

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

src/Stores/CallStore.js

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import P2PEncryptor from '../Calls/P2P/P2PEncryptor';
2424
const JOIN_TRACKS = true;
2525
const UNIFY_SDP = true;
2626
const UNIFY_CANDIDATE = true;
27-
const TG_CALLS = true;
2827
const TG_CALLS_MEDIA_STATE = true;
2928
const TG_CALLS_SDP = true;
3029
export const TG_CALLS_SDP_STRING = true;
@@ -2006,7 +2005,7 @@ class CallStore extends EventEmitter {
20062005

20072006
const { is_outgoing } = call;
20082007

2009-
let type = TG_CALLS ? data['@type'] || data.type : data.type;
2008+
let type = data['@type'] || data.type;
20102009
switch (type) {
20112010
case 'InitialSetup': {
20122011
console.log('[sdp] InitialSetup', data);
@@ -2185,19 +2184,13 @@ class CallStore extends EventEmitter {
21852184
p2pSendIceCandidate(callId, iceCandidate) {
21862185
LOG_P2P_CALL('p2pSendIceCandidate', callId, iceCandidate);
21872186
if (UNIFY_CANDIDATE) {
2188-
if (TG_CALLS) {
2189-
let { candidate, sdpMLineIndex } = iceCandidate;
2190-
if (sdpMLineIndex !== 0) {
2191-
return;
2192-
}
2193-
2194-
candidate = p2pParseCandidate(candidate);
2195-
this.p2pSendCallSignalingData(callId, JSON.stringify({ '@type': 'Candidates', candidates: [candidate] }));
2196-
} else {
2197-
let { candidate, sdpMLineIndex, sdpMid } = iceCandidate;
2198-
candidate = p2pParseCandidate(candidate);
2199-
this.p2pSendCallSignalingData(callId, JSON.stringify({ type: 'candidate', candidate, sdpMLineIndex, sdpMid }));
2187+
let { candidate, sdpMLineIndex } = iceCandidate;
2188+
if (sdpMLineIndex !== 0) {
2189+
return;
22002190
}
2191+
2192+
candidate = p2pParseCandidate(candidate);
2193+
this.p2pSendCallSignalingData(callId, JSON.stringify({ '@type': 'Candidates', candidates: [candidate] }));
22012194
} else {
22022195
const { candidate, sdpMLineIndex, sdpMid } = iceCandidate;
22032196
this.p2pSendCallSignalingData(callId, JSON.stringify({ type: 'candidate', candidate, sdpMLineIndex, sdpMid }));
@@ -2213,20 +2206,11 @@ class CallStore extends EventEmitter {
22132206
p2pSendSdp(callId, sdpData) {
22142207
LOG_P2P_CALL('p2pSendSdp', callId, sdpData);
22152208
if (UNIFY_SDP) {
2216-
if (TG_CALLS) {
2217-
const { type, sdp } = sdpData;
2218-
const sdpInfo = p2pParseSdp(sdp);
2219-
sdpInfo['@type'] = type;
2220-
2221-
this.p2pSendCallSignalingData(callId, JSON.stringify(sdpInfo));
2222-
} else {
2223-
const { type, sdp } = sdpData;
2224-
const sdpInfo = p2pParseSdp(sdp);
2225-
sdpInfo.type = type;
2226-
// sdpInfo.sdp = sdp;
2209+
const { type, sdp } = sdpData;
2210+
const sdpInfo = p2pParseSdp(sdp);
2211+
sdpInfo['@type'] = type;
22272212

2228-
this.p2pSendCallSignalingData(callId, JSON.stringify(sdpInfo));
2229-
}
2213+
this.p2pSendCallSignalingData(callId, JSON.stringify(sdpInfo));
22302214
} else {
22312215
this.p2pSendCallSignalingData(callId, JSON.stringify(sdpData));
22322216
}

0 commit comments

Comments
 (0)