[SailfishDevel] Sending SMS via Telepathy: Error "Channel Dispatcher .. does not support interface CD.I.Messages"
christopher.lamb at thurweb.ch
christopher.lamb at thurweb.ch
Thu Aug 13 21:04:40 UTC 2015
Hi All
I now have a working work-around: My app can (finally) send SMSes via
Telepathy again.
Previously I was using ContactMessenger object. Now I have found a
vector using the ConversationChannel object. It took a lot of hacking
around due to my weak understanding of c++, but in the end I hit on a
solution that required minimal change to both my code, and to
ConversationChannel.
I grabbed the code below:
https://github.com/nemomobile/nemo-qml-plugin-messages/blob/master/src/conversationchannel.h
https://github.com/nemomobile/nemo-qml-plugin-messages/blob/master/src/conversationchannel.cpp
then pimped it slightly so it that on a successful sendMessage, it emits
the signal "finished"
Previously, using ContactMessenger my code was
void TelepathyHelper::sendSMS(const QString &contactIdentifier, const
QString &message)
{
Tp::AccountPtr acc =
Tp::Account::create(TP_QT_ACCOUNT_MANAGER_BUS_NAME,
QLatin1String("/org/freedesktop/Telepathy/Account/ring/tel/account0"));
messenger = Tp::ContactMessenger::create(acc, contactIdentifier);
connect(messenger->sendMessage(message),
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onSendMessageFinished(Tp::PendingOperation*)));
}
Now (temporarily) using ConversationChannel my code is:
void TelepathyHelper::sendSMS(const QString &contactIdentifier, const
QString &message)
{
ConversationChannel *conversationChannel = new
ConversationChannel("/org/freedesktop/Telepathy/Account/ring/tel/account0",
contactIdentifier);
connect(conversationChannel,
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onSendMessageFinished(Tp::PendingOperation*)));
//this works! SMS is sent!!!! yippeee !!!
conversationChannel->sendMessage(message);
}
Cheers
Chris
Am 2015-08-12 14:26, schrieb christopher.lamb at thurweb.ch:
> Hi Matt
> .....
> My main focus now is finding a code approach that works with the
> current installed packages. I think I have found a vector, but need to
> do some more coding to know for sure.
> .....
>
> Thanks
>
> Chris
>
More information about the Devel
mailing list