+ self.session.texts.updateSignalHandler.unregister_sink(
+ self.__callback
+ )
+ self.__callback = None
+
+ self.__channelManager.close()
+ self.session.save(self.__cachePath)
+ self.session.logout()
+ self.session.close()
+
+ self.manager.disconnected(self)
+
+ self._cancel_delayed_disconnect()
+ self.__connection = None
+ _moduleLogger.info("Disconnected")
+
+ @gtk_toolbox.log_exception(_moduleLogger)
+ def _on_conversations_updated(self, conv, conversationIds):
+ _moduleLogger.debug("Incoming messages from: %r" % (conversationIds, ))
+ for phoneNumber in conversationIds:
+ h = self.get_handle_by_name(telepathy.HANDLE_TYPE_CONTACT, phoneNumber)
+ # 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)
+ if self.__channelManager.channel_exists(props):
+ continue
+
+ # Maemo 4.1's RTComm opens a window for a chat regardless if a
+ # message is received or not, so we need to do some filtering here
+ mergedConv = conv.get_conversation(phoneNumber)
+ unreadConvs = [
+ conversation
+ for conversation in mergedConv.conversations
+ if not conversation.isRead and not conversation.isArchived
+ ]
+ if not unreadConvs:
+ continue
+
+ chan = self.__channelManager.channel_for_props(props, signal=True)