diff --git a/js/key_worker.js b/js/key_worker.js index c9d39f44c..4d5e2a0d7 100644 --- a/js/key_worker.js +++ b/js/key_worker.js @@ -38162,25 +38162,14 @@ window.axolotl.sessions = { textsecure.storage.sessions._removeIdentityKeyForNumber(number); }, - getDeviceObject: function(encodedNumber, returnIdentityKey) { + getDeviceObject: function(encodedNumber) { var number = textsecure.utils.unencodeNumber(encodedNumber)[0]; var devices = textsecure.storage.devices.getDeviceObjectsForNumber(number); - if (devices.length == 0) { - if (returnIdentityKey) { - var identityKey = textsecure.storage.devices.getIdentityKeyForNumber(number); - if (identityKey !== undefined) - return {identityKey: identityKey}; - } - return undefined; - } for (var i in devices) if (devices[i].encodedNumber == encodedNumber) return devices[i]; - if (returnIdentityKey) - return {identityKey: devices[0].identityKey}; - return undefined; }, diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 674478588..80719bcdc 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38161,25 +38161,14 @@ window.axolotl.sessions = { textsecure.storage.sessions._removeIdentityKeyForNumber(number); }, - getDeviceObject: function(encodedNumber, returnIdentityKey) { + getDeviceObject: function(encodedNumber) { var number = textsecure.utils.unencodeNumber(encodedNumber)[0]; var devices = textsecure.storage.devices.getDeviceObjectsForNumber(number); - if (devices.length == 0) { - if (returnIdentityKey) { - var identityKey = textsecure.storage.devices.getIdentityKeyForNumber(number); - if (identityKey !== undefined) - return {identityKey: identityKey}; - } - return undefined; - } for (var i in devices) if (devices[i].encodedNumber == encodedNumber) return devices[i]; - if (returnIdentityKey) - return {identityKey: devices[0].identityKey}; - return undefined; }, diff --git a/libtextsecure/storage/devices.js b/libtextsecure/storage/devices.js index 3c5a6bee4..2f56fa0e9 100644 --- a/libtextsecure/storage/devices.js +++ b/libtextsecure/storage/devices.js @@ -131,25 +131,14 @@ textsecure.storage.sessions._removeIdentityKeyForNumber(number); }, - getDeviceObject: function(encodedNumber, returnIdentityKey) { + getDeviceObject: function(encodedNumber) { var number = textsecure.utils.unencodeNumber(encodedNumber)[0]; var devices = textsecure.storage.devices.getDeviceObjectsForNumber(number); - if (devices.length == 0) { - if (returnIdentityKey) { - var identityKey = textsecure.storage.devices.getIdentityKeyForNumber(number); - if (identityKey !== undefined) - return {identityKey: identityKey}; - } - return undefined; - } for (var i in devices) if (devices[i].encodedNumber == encodedNumber) return devices[i]; - if (returnIdentityKey) - return {identityKey: devices[0].identityKey}; - return undefined; },