Skip to content

Commit ea0cd0c

Browse files
author
evgeny-nadymov
committed
Fixes
1 parent c7f2ab9 commit ea0cd0c

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"homepage": "https://evgeny-nadymov.github.io/telegram-react",
33
"name": "telegram_react",
4-
"version": "0.0.978",
4+
"version": "0.0.979",
55
"private": true,
66
"dependencies": {
77
"tdweb": "^1.7.2",

src/Calls/P2P/P2PSdpBuilder.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export function p2pParseCandidate(candidate) {
2525
component,
2626
protocol,
2727
priority,
28-
ip,
29-
port
28+
address: { ip, port }
3029
};
3130

3231
for (let i = 0; i < other.length; i += 2) {
@@ -36,11 +35,19 @@ export function p2pParseCandidate(candidate) {
3635
break;
3736
}
3837
case 'raddr': {
39-
c.relAddr = other[i + 1];
38+
if (!c.relAddress) {
39+
c.relAddress = { };
40+
}
41+
42+
c.relAddress.ip = other[i + 1];
4043
break;
4144
}
4245
case 'rport': {
43-
c.relPort = other[i + 1];
46+
if (!c.relAddress) {
47+
c.relAddress = { };
48+
}
49+
50+
c.relAddress.port = other[i + 1];
4451
break;
4552
}
4653
case 'generation': {
@@ -186,7 +193,7 @@ export function p2pParseSdp(sdp) {
186193
for (let i = 0; i < types.length; i++) {
187194
const { id } = types[i];
188195
if (rtcpFb.has(id)) {
189-
types[i].feedback = rtcpFb.get(id);
196+
types[i].feedbackTypes = rtcpFb.get(id);
190197
}
191198
if (fmtp.has(id)) {
192199
types[i].parameters = fmtp.get(id);
@@ -252,11 +259,11 @@ export function addPayloadTypes(types) {
252259

253260
for (let i = 0; i < types.length; i++) {
254261
const type = types[i];
255-
const { id, name, clockrate, channels, feedback, parameters } = type;
262+
const { id, name, clockrate, channels, feedbackTypes, parameters } = type;
256263
sdp += `
257264
a=rtpmap:${id} ${name}/${clockrate}${channels ? '/' + channels : ''}`;
258-
if (feedback) {
259-
feedback.forEach(x => {
265+
if (feedbackTypes) {
266+
feedbackTypes.forEach(x => {
260267
const { type, subtype } = x;
261268
sdp += `
262269
a=rtcp-fb:${id} ${[type, subtype].join(' ')}`;
@@ -320,17 +327,15 @@ export class P2PSdpBuilder {
320327
static generateCandidate(info) {
321328
if (!info) return null;
322329

323-
const { sdpMLineIndex, sdpMid, foundation, component, protocol, priority, ip, port, type, relAddr, relPort, generation, tcpType, networkId, networkCost, username } = info;
324-
let candidate = `candidate:${foundation} ${component} ${protocol} ${priority} ${ip} ${port}`;
330+
const { sdpMLineIndex, sdpMid, foundation, component, protocol, priority, address, type, relAddress, generation, tcpType, networkId, networkCost, username } = info;
331+
let candidate = `candidate:${foundation} ${component} ${protocol} ${priority} ${address.ip} ${address.port}`;
325332
const attrs = []
326333
if (type) {
327334
attrs.push(`typ ${type}`);
328335
}
329-
if (relAddr) {
330-
attrs.push(`raddr ${relAddr}`);
331-
}
332-
if (relPort) {
333-
attrs.push(`rport ${relPort}`);
336+
if (relAddress) {
337+
attrs.push(`raddr ${relAddress.ip}`);
338+
attrs.push(`rport ${relAddress.port}`);
334339
}
335340
if (generation) {
336341
attrs.push(`generation ${generation}`);

src/Stores/CallStore.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,9 +1500,9 @@ class CallStore extends EventEmitter {
15001500
'@type': 'callProtocol',
15011501
udp_p2p: true,
15021502
udp_reflector: true,
1503-
min_layer: 126,
1504-
max_layer: 126,
1505-
library_versions: ['3.0.0']
1503+
min_layer: 92,
1504+
max_layer: 92,
1505+
library_versions: ['4.0.0']
15061506
};
15071507
}
15081508

0 commit comments

Comments
 (0)