Переглянути джерело

Add @saltyrtc/task-relayed-data

Danilo Bargen 7 роки тому
батько
коміт
5085c2067a
8 змінених файлів з 21 додано та 5 видалено
  1. 1 0
      dist/package.sh
  2. 1 0
      index.html
  3. 8 3
      package-lock.json
  4. 2 1
      package.json
  5. 1 0
      src/config.ts
  6. 0 1
      src/services/peerconnection.ts
  7. 7 0
      src/services/webclient.ts
  8. 1 0
      src/threema.d.ts

+ 1 - 0
dist/package.sh

@@ -60,6 +60,7 @@ targets=(
     @saltyrtc/chunked-dc/dist/chunked-dc.es5.js
     @saltyrtc/client/dist/saltyrtc-client.es5.js
     @saltyrtc/task-webrtc/dist/saltyrtc-task-webrtc.es5.js
+    @saltyrtc/task-relayed-data/dist/saltyrtc-task-relayed-data.es5.js
     webrtc-adapter/out/adapter_no_edge.js
     webrtc-adapter/out/adapter.js
     qrcode-generator/js/qrcode.js

+ 1 - 0
index.html

@@ -128,6 +128,7 @@
     <script src="node_modules/@saltyrtc/chunked-dc/dist/chunked-dc.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/@saltyrtc/client/dist/saltyrtc-client.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/@saltyrtc/task-webrtc/dist/saltyrtc-task-webrtc.es5.js?v=[[VERSION]]"></script>
+    <script src="node_modules/@saltyrtc/task-relayed-data/dist/saltyrtc-task-relayed-data.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/croppie/croppie.min.js?v=[[VERSION]]"></script>
     <script src="node_modules/autolinker/dist/Autolinker.min.js?v=[[VERSION]]"></script>
 

+ 8 - 3
package-lock.json

@@ -10,9 +10,14 @@
       "integrity": "sha1-ft8+rWGG7n7a2txokugdzkPw5a0="
     },
     "@saltyrtc/client": {
-      "version": "0.10.0",
-      "resolved": "https://registry.npmjs.org/@saltyrtc/client/-/client-0.10.0.tgz",
-      "integrity": "sha512-WADpJAOxcDz8DmezDExPjA79z2eDLTnqazHosB9YAMhtRTeXh60ar9MV/TfBfUDQZxXlyScV26HU2KYFF3ebmQ=="
+      "version": "0.10.1",
+      "resolved": "https://registry.npmjs.org/@saltyrtc/client/-/client-0.10.1.tgz",
+      "integrity": "sha512-7FDHXIqjOfJbo4o7d43yHQpb10x2y4Btpr0aVkUaB/NerK2+bU2cbXZKR/98ET4Sz6a8mKHl9eJOnEd4Rk51TA=="
+    },
+    "@saltyrtc/task-relayed-data": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/@saltyrtc/task-relayed-data/-/task-relayed-data-0.1.2.tgz",
+      "integrity": "sha512-+a/tiIA3bDNkCgnJYQz/Om6T+oeMpEabOL808/1/GF776D1XWkN0lVPv1boHTjb/nT+9haJEzdU0qAnZzduIiQ=="
     },
     "@saltyrtc/task-webrtc": {
       "version": "0.10.0",

+ 2 - 1
package.json

@@ -26,8 +26,9 @@
   "private": true,
   "homepage": "https://threema.ch/",
   "dependencies": {
-    "@saltyrtc/client": "^0.10.0",
+    "@saltyrtc/client": "^0.10.1",
     "@saltyrtc/task-webrtc": "^0.10.0",
+    "@saltyrtc/task-relayed-data": "^0.1.2",
     "@types/angular": "^1.6.43",
     "@types/angular-material": "^1.1.58",
     "@types/angular-sanitize": "^1.3.7",

+ 1 - 0
src/config.ts

@@ -31,6 +31,7 @@ export default {
     PUSH_URL: 'https://push-web.threema.ch/push',
 
     // Debugging options
+    DEBUG: false,
     MSG_DEBUGGING: false,
     ICE_DEBUGGING: false,
 

+ 0 - 1
src/services/peerconnection.ts

@@ -15,7 +15,6 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
-/// <reference types="@saltyrtc/task-webrtc" />
 import * as SDPUtils from 'sdp';
 
 /**

+ 7 - 0
src/services/webclient.ts

@@ -15,6 +15,9 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
+/// <reference types="@saltyrtc/task-webrtc" />
+/// <reference types="@saltyrtc/task-relayed-data" />
+
 import * as msgpack from 'msgpack-lite';
 import {hexToU8a} from '../helpers';
 import {BatteryStatusService} from './battery';
@@ -161,6 +164,7 @@ export class WebClientService {
     private saltyRtcHost: string = null;
     public salty: saltyrtc.SaltyRTC = null;
     private webrtcTask: saltyrtc.tasks.webrtc.WebRTCTask = null;
+    private relayedDataTask: saltyrtc.tasks.relayed_data.RelayedDataTask = null;
     private secureDataChannel: saltyrtc.tasks.webrtc.SecureDataChannel = null;
 
     // Messenger data
@@ -324,6 +328,9 @@ export class WebClientService {
         const maxPacketSize = this.browserService.getBrowser().firefox ? 16384 : 65536;
         this.webrtcTask = new saltyrtcTaskWebrtc.WebRTCTask(true, maxPacketSize);
 
+        // Create Relayed Data task instance
+        this.relayedDataTask = new saltyrtcTaskRelayedData.RelayedDataTask(this.config.DEBUG);
+
         // Create new keystore if necessary
         if (!keyStore) {
             keyStore = new saltyrtcClient.KeyStore();

+ 1 - 0
src/threema.d.ts

@@ -454,6 +454,7 @@ declare namespace threema {
         SALTYRTC_HOST_SUFFIX: string | null;
         ICE_SERVERS: RTCIceServer[];
         PUSH_URL: string;
+        DEBUG: boolean;
         MSG_DEBUGGING: boolean;
         ICE_DEBUGGING: boolean;
     }