From cf85c5e25ee21a806da747080442373f23d5ea48 Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 24 Nov 2015 16:14:33 -0800 Subject: [PATCH] Fix key conflict with self after master device re-install Fix bug where re-installing would cause sync messages to fail and produce unresolvable error indicators on messages that were actually sent. // FREEBIE --- js/libtextsecure.js | 4 ++++ libtextsecure/account_manager.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 8b85e8c9..a7ac81d8 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -36584,6 +36584,10 @@ var TextSecureServer = (function() { textsecure.storage.remove('device_name'); textsecure.storage.remove('regionCode'); + // remove our own identity key, which may have changed + // if we're relinking after a reinstall on the master device + textsecure.storage.axolotl.removeIdentityKey(number); + textsecure.storage.put('identityKey', identityKeyPair); textsecure.storage.put('signaling_key', signalingKey); textsecure.storage.put('password', password); diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index 47197248..69a13c60 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -106,6 +106,10 @@ textsecure.storage.remove('device_name'); textsecure.storage.remove('regionCode'); + // remove our own identity key, which may have changed + // if we're relinking after a reinstall on the master device + textsecure.storage.axolotl.removeIdentityKey(number); + textsecure.storage.put('identityKey', identityKeyPair); textsecure.storage.put('signaling_key', signalingKey); textsecure.storage.put('password', password);