瀏覽代碼

Don't re-encode relayed data messages

Danilo Bargen 7 年之前
父節點
當前提交
2515952eca
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/services/webclient.ts

+ 2 - 2
src/services/webclient.ts

@@ -2536,15 +2536,15 @@ export class WebClientService {
         if (this.config.MSG_DEBUGGING) {
             this.$log.debug('[Message] Outgoing:', message.type, '/', message.subType, message);
         }
-        const bytes: Uint8Array = this.msgpackEncode(message);
         switch (this.chosenTask) {
             case threema.ChosenTask.WebRTC:
                 // Send bytes through WebRTC DataChannel
+                const bytes: Uint8Array = this.msgpackEncode(message);
                 this.secureDataChannel.send(bytes);
                 break;
             case threema.ChosenTask.RelayedData:
                 // Send bytes through e2e encrypted WebSocket
-                this.relayedDataTask.sendMessage(bytes);
+                this.relayedDataTask.sendMessage(message);
                 break;
         }
     }