Bug 45733

Summary: File transfer needs to carry sender service-id in metadata
Product: Ytstenut Reporter: Robert Staudinger <robert.staudinger>
Component: ytstenut-glibAssignee: Robert Staudinger <robert.staudinger>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: highest CC: jonny.lamb, olli.salli
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: 0001-server-file-transfer-print-ServiceName-channel-metad.patch

Description Robert Staudinger 2012-02-07 02:59:52 UTC
$ ./server-file-transfer

usage: /home/robsta/Devel/ytstenut/telepathy-ytstenut-build/telepathy-ytstenut-glib/tests/.libs/lt-server-file-transfer [account name] [contact id] [local service name] [remote service name] [file to send]

$ ./server-file-transfer gabble/jabber/ytstenut1_40test_2ecollabora_2eco_2euk0 ytstenut2@test.collabora.co.uk recipient.service.name sender.service.name

waiting for a file transfer channel...
handling file transfer channel: /org/freedesktop/Telepathy/Connection/gabble/jabber/ytstenut2_40test_2ecollabora_2eco_2euk_2fb332e903/FileTransferChannel/0x8c95be8 from recipient.service.name
saving file to: /tmp/test-ft
transferred 18 bytes...
transfer complete!
Comment 1 Robert Staudinger 2012-02-07 03:05:03 UTC
Created attachment 56703 [details] [review]
0001-server-file-transfer-print-ServiceName-channel-metad.patch

Print the file transfer channel's ServiceName metadata property when receiving a file.

This is just a debugging enhancement patch, not a fix.
Comment 2 Jonny Lamb 2012-02-13 10:33:09 UTC
Comment on attachment 56703 [details] [review]
0001-server-file-transfer-print-ServiceName-channel-metad.patch

Review of attachment 56703 [details] [review]:
-----------------------------------------------------------------

Seems fine apart from this.

::: telepathy-ytstenut-glib/tests/server-file-transfer.c
@@ +238,5 @@
>            G_CALLBACK (transferred_bytes_cb), NULL);
>  
> +      g_print ("handling file transfer channel: %s from %s\n",
> +          tp_proxy_get_object_path (chan),
> +          tp_asv_get_string (props, "org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata.ServiceName"));

Use TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME here instead of this static string.
Comment 3 Robert Staudinger 2012-02-13 11:59:51 UTC
As per Jonny's advice the sender needs to add its own service name to the metadata when requesting the channel.

Moving to ytstenut-glib.
Comment 4 Robert Staudinger 2012-02-13 15:17:10 UTC
(08:54:33 PM) jonnylamb: when you request the channel on the sending side, include the Metadata property.
(08:55:42 PM) jonnylamb: so, for example, when creating the GHashTable, add a key with value TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA
jonner jonnylamb 
(08:56:29 PM) jonnylamb: and create a a{sas} with: GHashTable<gchar*,gchar**> with SenderName={"foo.bar", NULL};
Comment 5 Robert Staudinger 2012-02-14 02:07:05 UTC
commit df8e6e7904be4f7ea632a956682eeb5471a5a95c
Author: Rob Staudinger <robsta@linux.intel.com>
Date:   Tue Feb 14 10:55:12 2012 +0100

    file-transfer: Pass sender service-id in file metadata
    
    The sender needs to add its own service-id to the metadata when
    transferring a file, so the recipient can look up who it is coming
    from.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45733

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.