Need to sync also when gateways change

This commit is contained in:
Stephen Paul Weber 2022-02-22 13:35:44 -05:00
parent 8a046bb5ae
commit 4b0ea5c7cd
No known key found for this signature in database
GPG key ID: D11C2911CE519CDE

View file

@ -3,6 +3,7 @@ package eu.siacs.conversations.services;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.Collection;
import java.util.HashMap;
import java.util.Objects;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -116,7 +117,7 @@ public class QuickConversationsService extends AbstractQuickConversationsService
}
protected boolean considerSync(final Account account, final List<String> gateways, final Map<String, PhoneNumberContact> contacts, final boolean forced) {
final int hash = contacts.keySet().hashCode();
final int hash = Objects.hash(contacts.keySet(), gateways);
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": consider sync of " + hash);
if (!mLastSyncAttempt.retry(hash) && !forced) {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": do not attempt sync");