def __init__(self, connection, manager, props, contactHandle): self.__manager = manager self.__props = props tp.ChannelTypeText.__init__(self, connection, manager, props) self.__nextRecievedId = 0 self.__otherHandle = contactHandle self.__callback = coroutines.func_sink( coroutines.expand_positional( self._on_conversations_updated ) ) self._conn.session.voicemails.updateSignalHandler.register_sink( self.__callback ) self._conn.session.texts.updateSignalHandler.register_sink( self.__callback ) # The only reason there should be anything in the conversation is if # its new, so report it all try: mergedConversations = self._conn.session.voicemails.get_conversation(self._contactKey) except KeyError: _moduleLogger.debug("No voicemails in the conversation yet for %r" % (self._contactKey, )) else: self._report_conversation(mergedConversations) try: mergedConversations = self._conn.session.texts.get_conversation(self._contactKey) except KeyError: _moduleLogger.debug("No texts conversation yet for %r" % (self._contactKey, )) else: self._report_conversation(mergedConversations)
def __init__(self, connection, manager, props, listHandle): tp.ChannelTypeContactList.__init__(self, connection, manager, props) tp.ChannelInterfaceGroup.__init__(self) self.__manager = manager self.__props = props self.__session = connection.session self.__listHandle = listHandle self.__members = set() if self._conn.options.useGVContacts: self._callback = coroutines.func_sink( coroutines.expand_positional( self._on_contacts_refreshed ) ) self.__session.addressbook.updateSignalHandler.register_sink( self._callback ) addressbook = connection.session.addressbook contacts = addressbook.get_numbers() self._process_refresh(addressbook, set(contacts), set(), set()) else: self._callback = None self.GroupFlagsChanged(0, 0)
def __init__(self, updateItems, name="", maxTime=DEFAULT_MAX_TIMEOUT): self._name = name self._updateItems = updateItems self._maxTime = maxTime self._isActive = False self._state = self.STATE_ACTIVE self._onTimeout = gobject_utils.Timeout(self._on_timeout) self._strategies = {} self._callback = coroutines.func_sink( coroutines.expand_positional(self._request_reset_timers))
def start(self): self.__callback = coroutines.func_sink( coroutines.expand_positional( self._on_conversations_updated ) ) self._connRef().session.voicemails.updateSignalHandler.register_sink( self.__callback ) self._connRef().session.texts.updateSignalHandler.register_sink( self.__callback )