25 #include <TelepathyQt/AccountFactory>
26 #include <TelepathyQt/ConnectionFactory>
27 #include <TelepathyQt/ClientRegistrar>
38 Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
39 Tp::Account::FeatureCore);
41 Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(
42 QDBusConnection::sessionBus(),
43 Tp::Features() << Tp::Connection::FeatureSelfContact
44 << Tp::Connection::FeatureCore
45 << Tp::Connection::FeatureConnected
48 Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
49 channelFactory->addCommonFeatures(Tp::Channel::FeatureCore);
51 Tp::Features textFeatures = Tp::Features() << Tp::TextChannel::FeatureMessageQueue
52 << Tp::TextChannel::FeatureMessageSentSignal
53 << Tp::TextChannel::FeatureChatState
54 << Tp::TextChannel::FeatureMessageCapabilities;
55 channelFactory->addFeaturesForTextChats(textFeatures);
56 channelFactory->addFeaturesForTextChatrooms(textFeatures);
59 Tp::Features() << Tp::Contact::FeatureAlias
60 << Tp::Contact::FeatureAvatarToken
61 << Tp::Contact::FeatureAvatarData
62 << Tp::Contact::FeatureCapabilities
63 << Tp::Contact::FeatureSimplePresence
67 m_registrar = Tp::ClientRegistrar::create(accountFactory, connectionFactory,
68 channelFactory, contactFactory);
69 m_registrar->registerClient(m_handler, QLatin1String(
"KDE.TextUi.ConversationWatcher"));
71 m_accountManager = Tp::AccountManager::create(accountFactory, connectionFactory, channelFactory, contactFactory);
72 m_accountManager->becomeReady();
77 kDebug() <<
"deleting text observer";
82 Q_ASSERT(!m_handler.isNull());
83 return m_handler.data();
88 return m_accountManager;