[SailfishDevel] Sending SMS Messages from Sailfish Alpha 2 from QML

John Brooks john.brooks at jollamobile.com
Fri Aug 9 20:57:28 UTC 2013

On Aug 9, 2013, at 10:23 AM, christopher.lamb at thurweb.ch wrote:

> Hi John
> I think the QML side should look like this:
>    TelepathyChannelManager {
>        id: handler
>    }
>    property var currentChannel: handler.getConversation("/org/freedesktop/Telepathy/Account/ring/tel/account0", "12345")
>        PullDownMenu {
>            MenuItem {
>                text: "Send Test SMS"
>                onClicked: {
>                    currentChannel.sendMessage("Hello world");
>                }
>            }
>        }
> Chris

Yes, that's basically correct. TelepathyChannelManager has a minor side effect - it's only meant to be instantiated once by whichever client is handling incoming messages for the user. I've submitted a small change that will make it more appropriate for use cases like yours at https://github.com/nemomobile/nemo-qml-plugin-messages/pull/4. You should use code like what you have above.

As I'm sure you can tell, these APIs were made with the primary message client in mind, and there were some architectural issues to work around. In the future, I may be changing the architecture to put all of the Telepathy logic in commhistory-daemon, and expose it via more useful API from there.

Let me know if there are any problems.

John Brooks

More information about the Devel mailing list