Populate registrationIds on deviceObjects

Saves us from doing so later.

// FREEBIE
This commit is contained in:
lilia 2015-11-17 11:56:45 -08:00
parent cf85c5e25e
commit adf8445b85
2 changed files with 16 additions and 6 deletions

View file

@ -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;
});
}));
});
});
},

View file

@ -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;
});
}));
});
});
},