aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/crypto/axolotl
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-12-25 18:34:29 +0100
committerChristian Schneppe <christian@pix-art.de>2016-12-25 18:34:29 +0100
commit96f6dd85984be62763e0f2a7f82a52d985802c2c (patch)
tree829b40824948be0622c0ac14e757e971a0eca302 /src/main/java/de/pixart/messenger/crypto/axolotl
parent1dbd4729843330b40d2b5b73e1e15da0214e345e (diff)
remove broken devices only once to prevent loops
Diffstat (limited to 'src/main/java/de/pixart/messenger/crypto/axolotl')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java7
1 files changed, 5 insertions, 2 deletions
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 587e6e12e..a80f625f4 100644
--- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
@@ -781,6 +781,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);
@@ -801,9 +803,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) {