Add device storage method to wipe an identity

This commit is contained in:
lilia 2015-02-20 14:43:22 -08:00 committed by Matt Corallo
parent 45a053b3a8
commit 676ad04958
4 changed files with 18 additions and 6 deletions

View file

@ -74,6 +74,13 @@
throw new Error("Attempted to overwrite a different identity key");
},
removeIdentityKeyForNumber: function(number) {
var map = textsecure.storage.getEncrypted("devices" + number);
if (map === undefined)
throw new Error("Tried to remove identity for unknown number");
textsecure.storage.removeEncrypted("devices" + number);
},
getDeviceObject: function(encodedNumber, returnIdentityKey) {
var number = textsecure.utils.unencodeNumber(encodedNumber)[0];
var devices = textsecure.storage.devices.getDeviceObjectsForNumber(number);