On Aug 9, 2013, at 10:23 AM, christopher.l...@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
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to