let hasPendingFetches() return true when fetching device ids

This commit is contained in:
Daniel Gultsch 2017-06-29 20:04:38 +02:00
parent 7a2856ac86
commit 8d6b2074cb

View file

@ -1138,12 +1138,14 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
if (fetchStatusMap.getAll(ownAddress.getName()).containsValue(FetchStatus.PENDING)) { if (fetchStatusMap.getAll(ownAddress.getName()).containsValue(FetchStatus.PENDING)) {
return true; return true;
} }
for(Jid jid : jids) { synchronized (this.fetchDeviceIdsMap) {
for (Jid jid : jids) {
SignalProtocolAddress foreignAddress = new SignalProtocolAddress(jid.toBareJid().toPreppedString(), 0); SignalProtocolAddress foreignAddress = new SignalProtocolAddress(jid.toBareJid().toPreppedString(), 0);
if (fetchStatusMap.getAll(foreignAddress.getName()).containsValue(FetchStatus.PENDING)) { if (fetchStatusMap.getAll(foreignAddress.getName()).containsValue(FetchStatus.PENDING) || this.fetchDeviceIdsMap.containsKey(jid)) {
return true; return true;
} }
} }
}
return false; return false;
} }