diff --git a/js/libtextsecure.js b/js/libtextsecure.js index e84ac0aef..016e508d8 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -36740,9 +36740,12 @@ var TextSecureServer = (function() { textsecure.storage.remove('device_name'); textsecure.storage.remove('regionCode'); - // remove our own identity key, which may have changed + // update our own identity key, which may have changed // if we're relinking after a reinstall on the master device - textsecure.storage.axolotl.removeIdentityKey(number); + var putIdentity = textsecure.storage.axolotl.putIdentityKey.bind( + null, number, identityKeyPair.pubKey + ); + textsecure.storage.axolotl.removeIdentityKey(number).then(putIdentity, putIdentity); textsecure.storage.put('identityKey', identityKeyPair); textsecure.storage.put('signaling_key', signalingKey); diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index 69a13c608..fe22d5cf6 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -106,9 +106,12 @@ textsecure.storage.remove('device_name'); textsecure.storage.remove('regionCode'); - // remove our own identity key, which may have changed + // update our own identity key, which may have changed // if we're relinking after a reinstall on the master device - textsecure.storage.axolotl.removeIdentityKey(number); + var putIdentity = textsecure.storage.axolotl.putIdentityKey.bind( + null, number, identityKeyPair.pubKey + ); + textsecure.storage.axolotl.removeIdentityKey(number).then(putIdentity, putIdentity); textsecure.storage.put('identityKey', identityKeyPair); textsecure.storage.put('signaling_key', signalingKey);