aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-12-18 11:47:42 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-12-18 11:47:42 +0100
commitdbda2afd6db9206284d6153960b836de088f0e20 (patch)
tree6697bae451adca5a98dd135e69237ca890ac0a80 /src/main/java
parent87746ca2ba62bc5e2893e4e6626e92ce87d6b15a (diff)
remove broken devices only once to prevent loops
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java7
1 files changed, 5 insertions, 2 deletions
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 6bd10c15..020b76a3 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -785,6 +785,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
}
}
+ private final Set<Integer> PREVIOUSLY_REMOVED_FROM_ANNOUNCEMENT = new HashSet<>();
+
private void finishBuildingSessionsFromPEP(final AxolotlAddress address) {
AxolotlAddress ownAddress = new AxolotlAddress(account.getJid().toBareJid().toPreppedString(), 0);
Map<Integer, FetchStatus> own = fetchStatusMap.getAll(ownAddress);
@@ -805,9 +807,10 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
Set<Integer> ownDeviceIds = new HashSet<>(getOwnDeviceIds());
boolean publish = false;
for(Map.Entry<Integer,FetchStatus> entry : own.entrySet()) {
- if (entry.getValue() == FetchStatus.ERROR && ownDeviceIds.remove(entry.getKey())) {
+ 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 "+entry.getKey()+". removing from annoucement");
+ Log.d(Config.LOGTAG,account.getJid().toBareJid()+": error fetching own device with id "+id+". removing from announcement");
}
}
if (publish) {