From b9dbf11ebc92147725d34d2d7cf25ed0daa4033c Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Thu, 18 Oct 2018 16:44:50 +1100 Subject: [PATCH] Fix various things from previous commits --- libloki/libloki-protocol.js | 8 ++++---- libtextsecure/outgoing_message.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libloki/libloki-protocol.js b/libloki/libloki-protocol.js index 059b261cb..f0bbbab96 100644 --- a/libloki/libloki-protocol.js +++ b/libloki/libloki-protocol.js @@ -74,13 +74,13 @@ ]); const preKeyMessage = new textsecure.protobuf.PreKeyBundleMessage({ - identityKey, + identityKey: new Uint8Array(identityKey), deviceId: 1, // TODO: fetch from somewhere preKeyId: preKey.keyId, signedKeyId, - preKey: preKey.pubKey, - signedKey: signedKey.pubKey, - signature: signedKey.signature, + preKey: new Uint8Array(preKey.pubKey), + signedKey: new Uint8Array(signedKey.pubKey), + signature: new Uint8Array(signedKey.signature), }); return preKeyMessage; diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index 665975f1b..badc6fe94 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -116,7 +116,7 @@ OutgoingMessage.prototype = { if (updateDevices === undefined) { return this.server.getKeysForNumber(number).then(handleResult); } - let promise = Promise.resolve(); + let promise = Promise.resolve(true); updateDevices.forEach(device => { promise = promise.then(() => Promise.all([ @@ -217,7 +217,7 @@ OutgoingMessage.prototype = { request: requestMessage }); const bytes = new Uint8Array(websocketMessage.encode().toArrayBuffer()) - bytes.toString(); // print bytes for debugging purposes: can be injected in mock socket server + console.log(bytes.toString()); // print bytes for debugging purposes: can be injected in mock socket server return bytes; }, doSendMessage(number, deviceIds, recurse) {