TpSessionChannel::TpSessionChannel(Tp::TextChannelPtr ch)
{
- // qDebug() << "TpSessionChannel::TpSessionChannel" <<"path " << ch->objectPath();
+ if(TpSession::tpsDebug()) qDebug() << "TpSessionChannel::TpSessionChannel" <<"path " << ch->objectPath();
channel=ch;
connect(channel->becomeReady(Tp::TextChannel::FeatureMessageQueue|Tp::TextChannel::FeatureMessageSentSignal),
SIGNAL(finished(Tp::PendingOperation *)),
SLOT(onChannelReady(Tp::PendingOperation *)));
+ connect(channel.data(),
+ SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)),
+ SLOT(onChannelDestroyed()));
}
void TpSessionChannel::onChannelCreated(Tp::PendingOperation *op)
{
- // qDebug() << "TpSessionChannel::onOutgoingChannelCreated" ;
+ if(TpSession::tpsDebug())qDebug() << "TpSessionChannel::onOutgoingChannelCreated" ;
if (op->isError()) {
qWarning() << "Connection cannot become connected" ;
return;
connect(channel->becomeReady(Tp::TextChannel::FeatureMessageQueue | Tp::TextChannel::FeatureMessageSentSignal),
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onChannelReady(Tp::PendingOperation*)));
+ connect(channel.data(),
+ SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)),
+ SLOT(onChannelDestroyed()));
}
QString TpSessionChannel::objectPath()
void TpSessionChannel::onChannelReady(Tp::PendingOperation *op)
{
Q_UNUSED(op);
- //qDebug() << "TpSessionChannel::onChannelReady type=" << channel->channelType() <<"path " << channel->objectPath() <<
- // "initiatorContact=" << (channel->initiatorContact() ? channel->initiatorContact()->id():"NULL");
+ if(TpSession::tpsDebug()) qDebug() << "TpSessionChannel::onChannelReady type=" << channel->channelType() <<"path " << channel->objectPath() <<
+ "initiatorContact=" << (channel->initiatorContact() ? channel->initiatorContact()->id():"NULL");
;
connect(channel.data(),
SIGNAL(messageReceived(const Tp::ReceivedMessage &)),
connect(channel.data(),
SIGNAL(messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &)),
SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &)));
- connect(channel.data(),SIGNAL(destroyed(QObject *)),SLOT(onChannelDestroyed(QObject *)));
+ connect(channel.data(),SIGNAL(destroyed(QObject *)),SLOT(onChannelDestroyed()));
if(peerId().isEmpty()) peerContact=channel->initiatorContact(); // If this is incoming channel
emit channelReady(this);
QList<Tp::ReceivedMessage> queuedMessages = channel->messageQueue();
return peerContact ? peerContact->id():QString();
}
-void TpSessionChannel::onChannelDestroyed(QObject *obj)
+void TpSessionChannel::onChannelDestroyed()
{
- Q_UNUSED(obj);
- qDebug() << "TpSessionChannel::onChannelDestroyed";
+ if(TpSession::tpsDebug()) qDebug() << "TpSessionChannel::onChannelDestroyed" << peerId() << objectPath();
//TpSessionChannel *call = (TpSessionChannel *) obj;
emit channelDestroyed(this);
}