Fix preKeyBundle not sending.

pull/50/head
Mikunj 7 years ago
parent 110387508f
commit b21a7197f7

@ -219,12 +219,16 @@ OutgoingMessage.prototype = {
return this.plaintext; return this.plaintext;
}, },
async wrapInWebsocketMessage(outgoingObject) { async wrapInWebsocketMessage(outgoingObject) {
const preKeyEnvelope = outgoingObject.preKeyBundleMessage ? {
preKeyBundleMessage: outgoingObject.preKeyBundleMessage,
} : {};
const messageEnvelope = new textsecure.protobuf.Envelope({ const messageEnvelope = new textsecure.protobuf.Envelope({
type: outgoingObject.type, type: outgoingObject.type,
source: outgoingObject.ourKey, source: outgoingObject.ourKey,
sourceDevice: outgoingObject.sourceDevice, sourceDevice: outgoingObject.sourceDevice,
timestamp: this.timestamp, timestamp: this.timestamp,
content: outgoingObject.content, content: outgoingObject.content,
...preKeyEnvelope,
}); });
const requestMessage = new textsecure.protobuf.WebSocketRequestMessage({ const requestMessage = new textsecure.protobuf.WebSocketRequestMessage({
id: new Uint8Array(libsignal.crypto.getRandomBytes(1))[0], // random ID for now id: new Uint8Array(libsignal.crypto.getRandomBytes(1))[0], // random ID for now

@ -24,7 +24,7 @@ message Envelope {
optional bytes content = 8; // Contains an encrypted Content optional bytes content = 8; // Contains an encrypted Content
optional string serverGuid = 9; optional string serverGuid = 9;
optional uint64 serverTimestamp = 10; optional uint64 serverTimestamp = 10;
optional PreKeyBundleMessage preKeyBundleMessage = 101; optional bytes preKeyBundleMessage = 101;
} }

Loading…
Cancel
Save