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