diff --git a/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java b/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java index a20751571a88264a05c08486044fe30abaa6d307..3b87b1602d65329ad7b389e1bcf128b3db5c4b3b 100644 --- a/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java +++ b/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java @@ -27,7 +27,7 @@ public class QuickConversationsService extends AbstractQuickConversationsService protected final AtomicInteger mRunningSyncJobs = new AtomicInteger(0); protected final SerialSingleThreadExecutor mSerialSingleThreadExecutor = new SerialSingleThreadExecutor(QuickConversationsService.class.getSimpleName()); - protected Attempt mLastSyncAttempt = Attempt.NULL; + protected HashMap mLastSyncAttempt = new HashMap<>(); QuickConversationsService(XmppConnectionService xmppConnectionService) { super(xmppConnectionService); @@ -122,13 +122,13 @@ public class QuickConversationsService extends AbstractQuickConversationsService protected boolean considerSync(final Account account, final List gateways, final Map contacts, final boolean forced) { final int hash = Objects.hash(contacts.keySet(), gateways); Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": consider sync of " + hash); - if (!mLastSyncAttempt.retry(hash) && !forced) { + if (!mLastSyncAttempt.getOrDefault(account.getUuid(), Attempt.NULL).retry(hash) && !forced) { Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": do not attempt sync"); return false; } mRunningSyncJobs.incrementAndGet(); - mLastSyncAttempt = Attempt.create(hash); + mLastSyncAttempt.put(account.getUuid(), Attempt.create(hash)); final List withSystemAccounts = account.getRoster().getWithSystemAccounts(PhoneNumberContact.class); for (Map.Entry item : contacts.entrySet()) { PhoneNumberContact phoneContact = item.getValue();