[dialer] Cast the Channel to CallChannel and call hangup on it

That seems to actually hang up the call
This commit is contained in:
Martin Klapetek 2015-06-18 14:41:03 +00:00
parent 5096dec3b5
commit eb176a4099

View file

@ -25,6 +25,7 @@
#include <TelepathyQt/PendingReady> #include <TelepathyQt/PendingReady>
#include <TelepathyQt/PendingContacts> #include <TelepathyQt/PendingContacts>
#include <TelepathyQt/TextChannel> #include <TelepathyQt/TextChannel>
#include <TelepathyQt/CallChannel>
#include <TelepathyQt/Types> #include <TelepathyQt/Types>
#include <TelepathyQt/ContactManager> #include <TelepathyQt/ContactManager>
@ -88,7 +89,7 @@ void TpCaller::hangUp()
qDebug() << "About to hangup" << m_callChannel << m_callChannel->isValid() << m_callChannel->connection(); qDebug() << "About to hangup" << m_callChannel << m_callChannel->isValid() << m_callChannel->connection();
if (m_callChannel && m_callChannel->isValid() && m_callChannel->connection()) { if (m_callChannel && m_callChannel->isValid() && m_callChannel->connection()) {
qDebug() << "Hanging up"; qDebug() << "Hanging up";
Tp::PendingOperation *op = m_callChannel->requestClose(); Tp::PendingOperation *op = qobject_cast<Tp::CallChannel*>(m_callChannel.data())->hangup();
connect(op, &Tp::PendingOperation::finished, [=]() { connect(op, &Tp::PendingOperation::finished, [=]() {
if (op->isError()) { if (op->isError()) {
qWarning() << "Unable to hang up:" << op->errorMessage(); qWarning() << "Unable to hang up:" << op->errorMessage();