2 * This file is part of sharing-plugin-template
4 * Copyright (C) 2008-2009 Nokia Corporation. All rights reserved.
6 * This maemo code example is licensed under a MIT-style license,
7 * that can be found in the file called "COPYING" in the root
15 #include <sharing-http.h>
21 * @account: #SharingTransfer to be send
22 * @con: Connection used
23 * @dead_mans_switch: Turn to %FALSE at least every 30 seconds.
25 * Sends #SharingTransfer to service.
27 * Returns: #SharingPluginInterfaceSendResult
29 SharingPluginInterfaceSendResult send (SharingTransfer* transfer,
30 ConIcConnection* con, gboolean* dead_mans_switch)
32 SharingPluginInterfaceSendResult ret = SHARING_SEND_SUCCESS;
34 SharingEntry *entry = sharing_transfer_get_entry( transfer );
38 for (GSList* p = sharing_entry_get_media (entry); p != NULL; p = g_slist_next(p)) {
39 SharingEntryMedia* media = p->data;
41 if (!sharing_entry_media_get_sent (media)) {
43 //result = my_send_task_post_function (my_send_task, media);
44 /* Process post result */
45 if (result == 0 /* EXAMPLE: MY_SEND_RESULT_SUCCESS */) {
46 /* If success mark media as sent */
47 sharing_entry_media_set_sent (media, TRUE);
48 /* And mark process to your internal data structure */
49 //my_send_task->upload_done += sharing_entry_media_get_size (media);
51 /* We have sent the file in last sharing-manager call */
52 //my_send_task->upload_done += sharing_entry_media_get_size (media);