From 8d6b2074cbec08f4ce2b44eaacb8af333fb1d10a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 29 Jun 2017 20:04:38 +0200 Subject: [PATCH] let hasPendingFetches() return true when fetching device ids --- .../conversations/crypto/axolotl/AxolotlService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 139b2d4bb..38f20c88c 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -1138,10 +1138,12 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { if (fetchStatusMap.getAll(ownAddress.getName()).containsValue(FetchStatus.PENDING)) { return true; } - for(Jid jid : jids) { - SignalProtocolAddress foreignAddress = new SignalProtocolAddress(jid.toBareJid().toPreppedString(), 0); - if (fetchStatusMap.getAll(foreignAddress.getName()).containsValue(FetchStatus.PENDING)) { - return true; + synchronized (this.fetchDeviceIdsMap) { + for (Jid jid : jids) { + SignalProtocolAddress foreignAddress = new SignalProtocolAddress(jid.toBareJid().toPreppedString(), 0); + if (fetchStatusMap.getAll(foreignAddress.getName()).containsValue(FetchStatus.PENDING) || this.fetchDeviceIdsMap.containsKey(jid)) { + return true; + } } } return false;