From b03548637cb7c66156f953b26a888d97edf314dd Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Mon, 26 Nov 2018 15:59:13 +1100 Subject: [PATCH] Fix getKeysForNumber when staleDevices is not empty --- libtextsecure/outgoing_message.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index a6fab39ac..7c3a93441 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -118,7 +118,7 @@ OutgoingMessage.prototype = { if (device.registrationId === 0) { window.log.info('device registrationId 0!'); } - return builder.processPreKey(device).catch(error => { + return builder.processPreKey(device).then(() => true).catch(error => { if (error.message === 'Identity key changed') { // eslint-disable-next-line no-param-reassign error.timestamp = this.timestamp; @@ -131,7 +131,7 @@ OutgoingMessage.prototype = { }); } - return true; + return false; }) ); // TODO: check if still applicable @@ -156,7 +156,7 @@ OutgoingMessage.prototype = { devices: [ { deviceId: device, preKey, signedPreKey, registrationId: 0 }, ], - }); + }).then(results => results.every(value => value === true)); }) .catch(e => { if (e.name === 'HTTPError' && e.code === 404) {