Fix string vs number comparison

Fix bug in device storage causing duplicate device messages after a 410.
This commit is contained in:
lilia 2015-06-04 16:20:07 -07:00
parent a9549e2e0f
commit 061d57c95a
2 changed files with 2 additions and 2 deletions

View file

@ -38131,7 +38131,7 @@ axolotlInternal.RecipientRecord = function() {
// Add pending devices from tempKeys
for (var encodedNumber in tempKeys) {
var deviceNumber = textsecure.utils.unencodeNumber(encodedNumber)[0];
var deviceId = textsecure.utils.unencodeNumber(encodedNumber)[1];
var deviceId = parseInt(textsecure.utils.unencodeNumber(encodedNumber)[1]);
if (deviceNumber === number && deviceIds.indexOf(deviceId) < 0) {
deviceIds.push(deviceId);
}

View file

@ -54,7 +54,7 @@
// Add pending devices from tempKeys
for (var encodedNumber in tempKeys) {
var deviceNumber = textsecure.utils.unencodeNumber(encodedNumber)[0];
var deviceId = textsecure.utils.unencodeNumber(encodedNumber)[1];
var deviceId = parseInt(textsecure.utils.unencodeNumber(encodedNumber)[1]);
if (deviceNumber === number && deviceIds.indexOf(deviceId) < 0) {
deviceIds.push(deviceId);
}