diff --git a/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java b/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java index b12bd1c3633a7f229c04e549ad1947278dba4777..9c72ceff15d34a7f4bfc3467dc7d377cc016014d 100644 --- a/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java +++ b/src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java @@ -97,9 +97,11 @@ public class QuickConversationsService extends AbstractQuickConversationsService } protected void considerSync(boolean forced) { - final ImmutableMap allContacts = PhoneNumberContact.load(service); + ImmutableMap allContacts = null; for (final Account account : service.getAccounts()) { List gateways = gateways(account); + if (gateways.size() < 1) continue; + if (allContacts == null) allContacts = PhoneNumberContact.load(service); refresh(account, gateways, allContacts.values()); if (!considerSync(account, gateways, allContacts, forced)) { service.syncRoster(account); diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 8ce0b212d8ed7d47d9289052d53bc89343caf94f..1d0edcddfa83a89ceff95f7d1aa2a0e70afe1b9f 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -4694,6 +4694,7 @@ public class XmppConnectionService extends Service { } if (disco.hasIdentity("gateway", "pstn")) { contact.registerAsPhoneAccount(this); + mQuickConversationsService.considerSyncBackground(false); } } else { final IqPacket request = new IqPacket(IqPacket.TYPE.GET); @@ -4714,6 +4715,7 @@ public class XmppConnectionService extends Service { if (discoveryResult.hasIdentity("gateway", "pstn")) { final Contact contact = account.getRoster().getContact(jid); contact.registerAsPhoneAccount(this); + mQuickConversationsService.considerSyncBackground(false); } } else { Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": mismatch in caps for contact " + jid + " " + presence.getVer() + " vs " + discoveryResult.getVer());