1 #include "tpsessionobserver.h"
3 #include <TelepathyQt4/Channel>
5 TpSessionObserver::TpSessionObserver(const Tp::ChannelClassList &channelFilter,TpSession *session):Tp::AbstractClientObserver(channelFilter)
8 qDebug() << __PRETTY_FUNCTION__ ;
11 void TpSessionObserver::observeChannels(const Tp::MethodInvocationContextPtr<> &context,
12 const Tp::AccountPtr &account,
13 const Tp::ConnectionPtr &connection,
14 const QList<Tp::ChannelPtr> &channels,
15 const Tp::ChannelDispatchOperationPtr &dispatchOperation,
16 const QList<Tp::ChannelRequestPtr> &requestsSatisfied,
17 const QVariantMap &observerInfo)
19 Q_UNUSED(dispatchOperation)
20 Q_UNUSED(requestsSatisfied)
21 Q_UNUSED(observerInfo)
24 qDebug() << "TpSessionObserver::observeChannels";
26 foreach(Tp::ChannelPtr channel, channels) {
27 QVariantMap properties = channel->immutableProperties();
28 QString channelType = properties.value(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".ChannelType")).toString();
29 if( !channelType.isNull() && !channelType.isEmpty()) {
30 qDebug() << "ChannelType=" << channelType;
31 tpSession->createChannelListener(channelType, context, account, channel);