diff --git a/js/libtextsecure.js b/js/libtextsecure.js index a7ac81d83..c01f8e294 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -35530,13 +35530,18 @@ axolotlInternal.RecipientRecord = function() { deviceIds.push(deviceId); } } - return deviceIds.map(function(deviceId) { + return Promise.all(deviceIds.map(function(deviceId) { var encodedNumber = number + '.' + deviceId; var deviceObject = tempKeys[encodedNumber] || {}; deviceObject.encodedNumber = encodedNumber; deviceObject.identityKey = identityKey; - return deviceObject; - }); + return textsecure.protocol_wrapper.getRegistrationId(encodedNumber).then(function(registrationId) { + if (deviceObject.registrationId === undefined) { + deviceObject.registrationId = registrationId; + } + return deviceObject; + }); + })); }); }); }, diff --git a/libtextsecure/storage/devices.js b/libtextsecure/storage/devices.js index 3f7b6a938..1e4dcbbef 100644 --- a/libtextsecure/storage/devices.js +++ b/libtextsecure/storage/devices.js @@ -73,13 +73,18 @@ deviceIds.push(deviceId); } } - return deviceIds.map(function(deviceId) { + return Promise.all(deviceIds.map(function(deviceId) { var encodedNumber = number + '.' + deviceId; var deviceObject = tempKeys[encodedNumber] || {}; deviceObject.encodedNumber = encodedNumber; deviceObject.identityKey = identityKey; - return deviceObject; - }); + return textsecure.protocol_wrapper.getRegistrationId(encodedNumber).then(function(registrationId) { + if (deviceObject.registrationId === undefined) { + deviceObject.registrationId = registrationId; + } + return deviceObject; + }); + })); }); }); },