requestedContactId, requestedContactNumber = handle.ContactHandle.from_handle_name(
requestedHandleName
)
+ if not requestedContactId:
+ # Sometimes GV doesn't give us a contactid for contacts, so
+ # let's slow things down just a tad for better consistency for
+ # the user
+ ids = list(self.session.addressbook.find_contacts_with_number(requestedContactNumber))
+ if ids:
+ requestedContactId = ids[0]
h = handle.create_handle(self, 'contact', requestedContactId, requestedContactNumber)
elif handleType == telepathy.HANDLE_TYPE_LIST:
# Support only server side (immutable) lists
def _on_conversations_updated(self, conv, conversationIds):
_moduleLogger.debug("Incoming messages from: %r" % (conversationIds, ))
for contactId, phoneNumber in conversationIds:
- h = handle.create_handle(self, 'contact', contactId, phoneNumber)
+ handleName = handle.ContactHandle.to_handle_name(contactId, phoneNumber)
+ h = self.get_handle_by_name(telepathy.HANDLE_TYPE_CONTACT, handleName)
# Just let the TextChannel decide whether it should be reported to the user or not
props = self._generate_props(telepathy.CHANNEL_TYPE_TEXT, h, False)
channel = self.__channelManager.channel_for_props(props, signal=True)