aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-12-18 11:49:27 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-12-18 11:49:27 +0100
commitfbbf1a37b47b3967699bdb88ac31f5959b34dba6 (patch)
treead591e80d086b37de15aeeeb162b488ac8dcb1d0 /src/main/java
parentdbda2afd6db9206284d6153960b836de088f0e20 (diff)
disable removing of broken devices by default
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java2
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java22
2 files changed, 14 insertions, 10 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index 6d69d36e..dbd27baf 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -81,6 +81,8 @@ public final class Config {
public static final long MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;
public static final long OMEMO_AUTO_EXPIRY = 7 * MILLISECONDS_IN_DAY;
+ public static final boolean REMOVE_BROKEN_DEVICES = false;
+
public static final boolean DISABLE_PROXY_LOOKUP = false; //useful to debug ibb
public static final boolean DISABLE_HTTP_UPLOAD = false;
diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
index 020b76a3..8f586f3a 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -804,17 +804,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);
}
}