- ]
- self._contacts[contactId] = (contactName, contactNumbers)
-
- def _populate_contact_details(self, contactId):
- if self._get_contact_details(contactId):
- return
- self._get_contact_details(contactId).extend(
- self._backend.get_contact_details(contactId)
- )
-
- def _get_contact_details(self, contactId):
- return self._contacts[contactId][1]
-
- def _has_contact_changed(self, contactId, oldContacts):
- oldContact = oldContacts[contactId]
- oldContactName = oldContact[0]
- oldContactDetails = oldContact[1]
- if oldContactName != self.get_contact_name(contactId):
- return True
- if not oldContactDetails:
- return False
- # if its already in the old cache, purposefully add it into the new cache
- return oldContactDetails != self.get_contact_details(contactId)
+ )
+ self._numbers.update(
+ (number, (contactName, phoneType, contactDetails))
+ for (number, phoneType) in contactNumbers
+ )