diff options
-rw-r--r-- | src/main/java/de/pixart/messenger/Config.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java | 22 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java index 5deba889b..42d642142 100644 --- a/src/main/java/de/pixart/messenger/Config.java +++ b/src/main/java/de/pixart/messenger/Config.java @@ -91,6 +91,7 @@ public final class Config { public static final int REFRESH_UI_INTERVAL = 1000; public static final long OMEMO_AUTO_EXPIRY = 7 * MILLISECONDS_IN_DAY; // delete old OMEMO devices after 7 days od inactivity + public static final boolean REMOVE_BROKEN_DEVICES = false; public static final int MAX_DISPLAY_MESSAGE_CHARS = 4096; diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java index a80f625f4..bedc0970a 100644 --- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java +++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java @@ -800,17 +800,19 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { } mXmppConnectionService.keyStatusUpdated(report); } - Set<Integer> ownDeviceIds = new HashSet<>(getOwnDeviceIds()); - boolean publish = false; - for(Map.Entry<Integer,FetchStatus> entry : own.entrySet()) { - int id = entry.getKey(); - if (entry.getValue() == FetchStatus.ERROR && PREVIOUSLY_REMOVED_FROM_ANNOUNCEMENT.add(id) && ownDeviceIds.remove(id)) { - publish = true; - Log.d(Config.LOGTAG,account.getJid().toBareJid()+": error fetching own device with id "+id+". removing from announcement"); + if (Config.REMOVE_BROKEN_DEVICES) { + Set<Integer> ownDeviceIds = new HashSet<>(getOwnDeviceIds()); + boolean publish = false; + for (Map.Entry<Integer, FetchStatus> entry : own.entrySet()) { + int id = entry.getKey(); + if (entry.getValue() == FetchStatus.ERROR && PREVIOUSLY_REMOVED_FROM_ANNOUNCEMENT.add(id) && ownDeviceIds.remove(id)) { + publish = true; + Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": error fetching own device with id " + id + ". removing from announcement"); + } + } + if (publish) { + publishOwnDeviceId(ownDeviceIds); } - } - if (publish) { - publishOwnDeviceId(ownDeviceIds); } } |