- def _create_contact_handle(self, name):
- requestedContactId = name
-
- contacts = self._addressbook.get_contacts()
- contactsFound = [
- contactId for contactId in contacts
- if contactId == requestedContactId
- ]
-
- if 0 < len(contactsFound):
- contactId = contactsFound[0]
- if len(contactsFound) != 1:
- _moduleLogger.error("Contact ID was not unique: %s for %s" % (contactId, ))
- else:
- contactId = requestedContactId
- h = handle.create_handle(self, 'contact', contactId)
+ def _create_contact_handle(self, requestedHandleName):
+ requestedContactId, requestedContactNumber = handle.ContactHandle.from_handle_name(
+ requestedHandleName
+ )
+ h = handle.create_handle(self, 'contact', requestedContactId, requestedContactNumber)
+ return h
+
+ @coroutines.func_sink
+ @coroutines.expand_positional
+ @gobject_utils.async
+ def _on_conversations_updated(self, conversationIds):
+ # @todo get conversations update running
+ # @todo test conversatiuons
+ channelManager = self._channelManager
+ for contactId, phoneNumber in conversationIds:
+ h = self._create_contact_handle(contactId, phoneNumber)
+ # if its new, __init__ will take care of things
+ # if its old, its own update will take care of it
+ channel = channelManager.channel_for_text(handle)