[Telepathy] tp-qt4 FileTransfer API proposal

George Goldberg george.goldberg at collabora.co.uk
Tue Sep 1 09:03:20 PDT 2009


Andre Moreira Magalhaes wrote:
> Hi,
>
> One more API sketch for review. This time we are going to implement
> FileTransfer
> support on tp-qt4 and I would like to have some review comments on the
> API.
>
> For those not familiar with FileTransfer please refer to
> http://telepathy.freedesktop.org/spec.html#org.freedesktop.Telepathy.Channel.Type.FileTransfer
>
>
> Aditional methods that will be added to Account:
>
> class Account ...
> {
>     ...
>
>    PendingChannelRequest *createFileTransfer(
>            const QString &contactIdentifier,
>            const QString &fileName,
>            const QString &contentType,
>            qulonglong size,
>            FileHashType contentHashType = (FileHashType) -1,
>            const QString &contentHash = QString(),
>            const QString &description = QString(),
>            QDateTime lastModificationTime = QDateTime(),
>            QDateTime userActionTime = QDateTime::currentDateTime(),
>            const QString &preferredHandler = QString());
>    PendingChannelRequest *createFileTransfer(
>            const ContactPtr &contact,
>            const QString &fileName,
>            const QString &contentType,
>            qulonglong size,
>            FileHashType contentHashType = (FileHashType) -1,
>            const QString &contentHash = QString(),
>            const QString &description = QString(),
>            QDateTime lastModificationTime = QDateTime(),
>            QDateTime userActionTime = QDateTime::currentDateTime(),
>            const QString &preferredHandler = QString());
>               ...
> }
I'm assuming these are named this way for consistency with the other
ensure/create channel methods on Tp::Account. This seems like a good
idea to me, so +1. However, I think the number of parameters there is
really frightening. If I understand the instructions below, you have to
call FileTransferChannel::provideFile() below anyway, so why does the
createFileTransfer method need all that information? Surely the CM is
what cares about the file hash, for example, not the client?


George

--
George Goldberg


More information about the telepathy mailing list