~singpolyma/cheogram-android

a8146ceee152c24a85c7126ff0a4cb0a612e5994 — Stephen Paul Weber a month ago 0837127 + aab94fd 2.10.6-1
Merge branch 'fix-contact-sync'

* fix-contact-sync:
  Contact sync needs to happen when we discover a new gateway
  Skip contact sync work if there are no gateways configured
M src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java => src/cheogram/java/eu/siacs/conversations/services/QuickConversationsService.java +3 -1
@@ 97,9 97,11 @@ public class QuickConversationsService extends AbstractQuickConversationsService
    }

    protected void considerSync(boolean forced) {
        final ImmutableMap<String, PhoneNumberContact> allContacts = PhoneNumberContact.load(service);
        ImmutableMap<String, PhoneNumberContact> allContacts = null;
        for (final Account account : service.getAccounts()) {
            List<String> 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);

M src/main/java/eu/siacs/conversations/services/XmppConnectionService.java => src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +2 -0
@@ 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());