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; }