From b21a7197f7ea474f7c6d5814bd58fed2465345ac Mon Sep 17 00:00:00 2001 From: Mikunj Date: Tue, 20 Nov 2018 16:20:57 +1100 Subject: [PATCH] Fix preKeyBundle not sending. --- libtextsecure/outgoing_message.js | 4 ++++ protos/SignalService.proto | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index b83a55b5e..2687ebea2 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -219,12 +219,16 @@ OutgoingMessage.prototype = { return this.plaintext; }, async wrapInWebsocketMessage(outgoingObject) { + const preKeyEnvelope = outgoingObject.preKeyBundleMessage ? { + preKeyBundleMessage: outgoingObject.preKeyBundleMessage, + } : {}; const messageEnvelope = new textsecure.protobuf.Envelope({ type: outgoingObject.type, source: outgoingObject.ourKey, sourceDevice: outgoingObject.sourceDevice, timestamp: this.timestamp, content: outgoingObject.content, + ...preKeyEnvelope, }); const requestMessage = new textsecure.protobuf.WebSocketRequestMessage({ id: new Uint8Array(libsignal.crypto.getRandomBytes(1))[0], // random ID for now diff --git a/protos/SignalService.proto b/protos/SignalService.proto index 5e2b905de..ecf9743d1 100644 --- a/protos/SignalService.proto +++ b/protos/SignalService.proto @@ -24,7 +24,7 @@ message Envelope { optional bytes content = 8; // Contains an encrypted Content optional string serverGuid = 9; optional uint64 serverTimestamp = 10; - optional PreKeyBundleMessage preKeyBundleMessage = 101; + optional bytes preKeyBundleMessage = 101; }