[Telepathy] File transfer with telepathy-qt4

Marco Todesco dermarcot84 at gmail.com
Mon May 24 01:46:17 PDT 2010


Hi,

I'm trying to get file transfer working. When I send a file I always
get the error "contact doesn't have file transfer capabilities".

Here is the debug output:

Debug: Telepathy-Qt4 (version 0.3.3.1) DEBUG: Creating a Channel
Debug: Telepathy-Qt4 (version 0.3.3.1) DEBUG: Returning cached
interface for "org.freedesktop.Telepathy.Connection.Interface.Requests"
Debug: Telepathy-Qt4 (version 0.3.3.1) DEBUG: CreateChannel
failed:"org.freedesktop.Telepathy.Error.NotCapable": "contact doesn't
have file transfer capabilities"

Here is what I basically do:

    if (!file_.open(QIODevice::ReadOnly)) {
        qCritical() << "Unable to open '" << fileName << "' for
reading:" << file_.errorString();
        return;
    }

    QVariantMap params;
    params.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL
".ChannelType"),
QLatin1String(TELEPATHY_INTERFACE_CHANNEL_TYPE_FILE_TRANSFER));
    params.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL
".TargetHandleType"), Tp::HandleTypeContact);
    params.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL
".TargetHandle"), contact->tpContact()->handle().at(0));
    params.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL_TYPE_FILE_TRANSFER
".Filename"), fileName);
    params.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL_TYPE_FILE_TRANSFER
".Size"), (qulonglong)file_.size());
    params.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL_TYPE_FILE_TRANSFER
".ContentType"), "application/octet-stream");

    Tp::PendingChannel* pending_channel = connection->createChannel(params);
    connect(pending_channel,
            SIGNAL(finished(Tp::PendingOperation*)),
            SLOT(onChannelCreated(Tp::PendingOperation*)));

Am I missing something?

Thanks
Marco


More information about the telepathy mailing list