From 061d57c95af3a43fc17ca32d2e1afa7ce5587279 Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 4 Jun 2015 16:20:07 -0700 Subject: [PATCH] Fix string vs number comparison Fix bug in device storage causing duplicate device messages after a 410. --- js/libtextsecure.js | 2 +- libtextsecure/storage/devices.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 993c8ce9..7112d193 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -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); } diff --git a/libtextsecure/storage/devices.js b/libtextsecure/storage/devices.js index 0cd713fd..e7bf0d59 100644 --- a/libtextsecure/storage/devices.js +++ b/libtextsecure/storage/devices.js @@ -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); }