aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-12-25 18:36:03 +0100
committerChristian Schneppe <christian@pix-art.de>2016-12-25 18:36:03 +0100
commite9728c689d6dcc917b07662bd840bbf7ccf0a335 (patch)
tree5cba241acb7e67147f0284b3abf966c4ab833d6f /src/main/java/de
parent96f6dd85984be62763e0f2a7f82a52d985802c2c (diff)
disable removing of broken devices by default
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/Config.java1
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java22
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);
}
}