Merge pull request #218 from ezeagwulae/contacts_fix

fix Contacts services to return iphone contacts
This commit is contained in:
Quentame 2020-01-29 13:47:34 +01:00 committed by GitHub
commit ec201f8e1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ class ContactsService(object):
""" """
The 'Contacts' iCloud service, connects to iCloud and returns contacts. The 'Contacts' iCloud service, connects to iCloud and returns contacts.
""" """
def __init__(self, service_root, session, params): def __init__(self, service_root, session, params):
self.session = session self.session = session
self.params = params self.params = params
@ -17,7 +18,7 @@ class ContactsService(object):
self._contacts_refresh_url = '%s/startup' % self._contacts_endpoint self._contacts_refresh_url = '%s/startup' % self._contacts_endpoint
self._contacts_changeset_url = '%s/changeset' % self._contacts_endpoint self._contacts_changeset_url = '%s/changeset' % self._contacts_endpoint
def refresh_client(self, from_dt=None, to_dt=None): def refresh_client(self):
""" """
Refreshes the ContactsService endpoint, ensuring that the Refreshes the ContactsService endpoint, ensuring that the
contacts data is up-to-date. contacts data is up-to-date.
@ -33,17 +34,6 @@ class ContactsService(object):
params=params_contacts params=params_contacts
) )
self.response = req.json() self.response = req.json()
params_refresh = dict(self.params)
params_refresh.update({
'prefToken': req.json()["prefToken"],
'syncToken': req.json()["syncToken"],
})
self.session.post(self._contacts_changeset_url, params=params_refresh)
req = self.session.get(
self._contacts_refresh_url,
params=params_contacts
)
self.response = req.json()
def all(self): def all(self):
""" """