Skip to content

Commit 42eb15a

Browse files
author
evgeny-nadymov
committed
Fixes
1 parent 7da6b4f commit 42eb15a

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

‎src/Calls/P2P/P2PEncryptor.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import CryptoJS from 'crypto-js';
99

10-
const MTPROTO_ENCRYPTION = false;
10+
const P2P_ENCRYPTION = false;
1111

1212
export default class P2PEncryptor {
13-
constructor(key) {
13+
constructor(key, isOutgoing) {
1414
const p2pKey = CryptoJS.enc.Base64.parse(key);
1515

1616
this.key = CryptoJS.enc.Hex.parse('3132333435363738393031323334353641424344454647484940414243444546');
@@ -20,7 +20,7 @@ export default class P2PEncryptor {
2020
}
2121

2222
encryptToBase64(str) {
23-
if (MTPROTO_ENCRYPTION) {
23+
if (P2P_ENCRYPTION) {
2424
const { key, iv, mode, padding } = this;
2525

2626
const encrypted = CryptoJS.AES.encrypt(str, key, {
@@ -31,12 +31,13 @@ export default class P2PEncryptor {
3131

3232
return encrypted.toString();
3333
} else {
34+
// to base64 string
3435
return btoa(str);
3536
}
3637
}
3738

3839
decryptFromBase64(base64) {
39-
if (MTPROTO_ENCRYPTION) {
40+
if (P2P_ENCRYPTION) {
4041
const { key, iv, mode, padding } = this;
4142

4243
const decrypted = CryptoJS.AES.decrypt(base64, key, {
@@ -47,6 +48,7 @@ export default class P2PEncryptor {
4748

4849
return decrypted.toString(CryptoJS.enc.Utf8);
4950
} else {
51+
// from base64 string
5052
return atob(base64);
5153
}
5254
}

‎src/Components/Calls/CallPanel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import LStore from '../../Stores/LocalizationStore';
3232
import UserStore from '../../Stores/UserStore';
3333
import './CallPanel.css';
3434

35-
const SUPPORTS_ROTATION = false;
35+
const SUPPORTS_ROTATION = true;
3636

3737
class CallPanel extends React.Component {
3838
constructor(props) {

‎src/Stores/CallStore.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -2039,12 +2039,21 @@ class CallStore extends EventEmitter {
20392039
if (inputStream) {
20402040
const answer = await connection.createAnswer();
20412041

2042-
console.log('[sdp] local', answer.type, answer.sdp);
2043-
await connection.setLocalDescription(answer);
2044-
20452042
const initialSetup = p2pParseSdp(answer.sdp);
20462043
initialSetup['@type'] = 'InitialSetup';
20472044

2045+
// if (initialSetup.video) {
2046+
// if (initialSetup.video.rtpExtensions) {
2047+
// initialSetup.video.rtpExtensions.push({ id: 13, uri: 'urn:3gpp:video-orientation' });
2048+
// console.log('[InitialSetup] push', initialSetup);
2049+
//
2050+
// answer.sdp = P2PSdpBuilder.generateAnswer(initialSetup);
2051+
// }
2052+
// }
2053+
2054+
console.log('[sdp] local', answer.type, answer.sdp);
2055+
await connection.setLocalDescription(answer);
2056+
20482057
console.log('[InitialSetup] send 1');
20492058
this.p2pSendInitialSetup(callId, initialSetup);
20502059
} else {

0 commit comments

Comments
 (0)