Thread: [SailfishOS+Harmattan] QDBusConnection: receive/send message
View Single Post
Posts: 133 | Thanked: 405 times | Joined on Mar 2012 @ Europe
#8
Dear Marxian,

Reading received messages and changing them in tracker works fine. But I spent the last week trying to send a DBus message to Telepathy - without success

I have to implement this method:
http://telepathy.freedesktop.org/spe...Messages1.html

So this is my code:

Code:
    QList<QVariant> args;

    QDBusObjectPath path("/org/freedesktop/Telepathy/Connection/gabble/jabber/XXX");
    QString targetID = "XXX@jabberes.org";
    args << qVariantFromValue(path);
    args << targetID;

    QMap<QString, QVariant> message;

    message["content"] = QVariant(qVariantFromValue("Message Content"));
    message["content-type"] = QVariant(qVariantFromValue(QString("text/plain")));

    QList<QVariant> msgList;
    msgList << qVariantFromValue(message);

    args << msgList;

    uint flags = 0;
    args << flags;

    m.setArguments(args);
   QDBusMessage retVal = QDBusConnection::sessionBus().call(m);
The retVal error code is:
Code:
QDBusMessage(type=Error, service="", error name="org.freedesktop.DBus.Error.UnknownMethod", error message="Method "SendMessage" with signature "osa{sv}u" on interface "org.freedesktop.Telepathy.ChannelDispatcher.Interface.Messages1" doesn't exist"
So my question is, how to create a message with this signature: "osaa{sv}u", especially this aa{sv}?

I know, there are heavy libs like TelepathyQt, but i want just to send only one message and hope, this could be done with a simple code...

Thank you for any hint.

Last edited by chrm; 2015-09-05 at 19:13. Reason: topic extension for "send"
 

The Following User Says Thank You to chrm For This Useful Post: