aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-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);
}
}