Merge pull request #227 from WhisperSystems/devices
Remove unsued argument from getDeviceObject
This commit is contained in:
commit
4157c2c7a4
3 changed files with 3 additions and 36 deletions
|
@ -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;
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue