summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-08-07 23:11:50 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-08-08 10:04:19 +0200
commit1fa1894ec4ac7dd2ba314716d5565f3dac87592a (patch)
tree20fe35b50b444314897a7ddc93ed308419ecb5e1 /tubes
parent35aa0360ed14ced09b803c2fc95ea095d4a6cb36 (diff)
tubes: use file channel description for sending UUID
Change-Id: I44129798110491cd59e1eb39d2f4c2cf3eb3c81b
Diffstat (limited to 'tubes')
-rw-r--r--tubes/inc/tubes/file-transfer-helper.h5
-rw-r--r--tubes/source/conference.cxx13
-rw-r--r--tubes/source/file-transfer-helper.c24
3 files changed, 38 insertions, 4 deletions
diff --git a/tubes/inc/tubes/file-transfer-helper.h b/tubes/inc/tubes/file-transfer-helper.h
index 8960d147969b..016aed8fdec7 100644
--- a/tubes/inc/tubes/file-transfer-helper.h
+++ b/tubes/inc/tubes/file-transfer-helper.h
@@ -93,6 +93,10 @@ void empathy_ft_handler_new_outgoing (
void empathy_ft_handler_set_service_name (
EmpathyFTHandler *self,
const gchar *service_name);
+void empathy_ft_handler_set_description (
+ EmpathyFTHandler *self,
+ const gchar *description);
+
void empathy_ft_handler_new_incoming (TpFileTransferChannel *channel,
EmpathyFTHandlerReadyCallback callback,
@@ -108,6 +112,7 @@ const char * empathy_ft_handler_get_filename (EmpathyFTHandler *handler);
const char * empathy_ft_handler_get_content_type (EmpathyFTHandler *handler);
TpContact * empathy_ft_handler_get_contact (EmpathyFTHandler *handler);
GFile * empathy_ft_handler_get_gfile (EmpathyFTHandler *handler);
+const char *empathy_ft_handler_get_description(EmpathyFTHandler*);
gboolean empathy_ft_handler_get_use_hash (EmpathyFTHandler *handler);
gboolean empathy_ft_handler_is_incoming (EmpathyFTHandler *handler);
guint64 empathy_ft_handler_get_transferred_bytes (EmpathyFTHandler *handler);
diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx
index bf33ebd27582..4bfd51c63b2e 100644
--- a/tubes/source/conference.cxx
+++ b/tubes/source/conference.cxx
@@ -474,16 +474,20 @@ void TeleConference::invite( TpContact *pContact )
-1, &handles, NULL, NULL, NULL, NULL, NULL );
}
-
+namespace {
class SendFileRequest {
public:
- SendFileRequest( TeleConference::FileSentCallback pCallback, void* pUserData)
+ SendFileRequest( TeleConference::FileSentCallback pCallback, void* pUserData, const char* sUuid )
: mpCallback(pCallback)
- , mpUserData(pUserData) {};
+ , mpUserData(pUserData)
+ , msUuid(sUuid)
+ {}
TeleConference::FileSentCallback mpCallback;
void* mpUserData;
+ const char* msUuid;
};
+}
static void TeleConference_TransferDone( EmpathyFTHandler *handler, TpFileTransferChannel *, gpointer user_data)
{
@@ -525,6 +529,7 @@ static void TeleConference_FTReady( EmpathyFTHandler *handler, GError *error, gp
g_signal_connect(handler, "transfer-error",
G_CALLBACK (TeleConference_TransferError), request);
empathy_ft_handler_set_service_name(handler, TeleManager::getFullServiceName().getStr());
+ empathy_ft_handler_set_description(handler, request->msUuid);
empathy_ft_handler_start_transfer(handler);
}
}
@@ -549,7 +554,7 @@ void TeleConference::sendFile( TpContact* pContact, const OUString& localUri, Fi
GFile *pSource = g_file_new_for_uri(
OUStringToOString( localUri, RTL_TEXTENCODING_UTF8).getStr() );
- SendFileRequest *pReq = new SendFileRequest( pCallback, pUserData);
+ SendFileRequest *pReq = new SendFileRequest( pCallback, pUserData, msUuid.getStr() );
empathy_ft_handler_new_outgoing( mpAccount,
pContact,
diff --git a/tubes/source/file-transfer-helper.c b/tubes/source/file-transfer-helper.c
index c5049f8dcfb4..6450343bbb09 100644
--- a/tubes/source/file-transfer-helper.c
+++ b/tubes/source/file-transfer-helper.c
@@ -923,6 +923,9 @@ ft_handler_populate_outgoing_request (EmpathyFTHandler *handler)
if (priv->service_name != NULL)
tp_asv_set_string (priv->request, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME, priv->service_name);
+ if (priv->description != NULL)
+ tp_asv_set_string (priv->request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, priv->description);
+
g_free (uri);
}
@@ -1455,6 +1458,15 @@ empathy_ft_handler_set_service_name (
self->priv->service_name = g_strdup (service_name);
}
+void
+empathy_ft_handler_set_description (
+ EmpathyFTHandler *self,
+ const gchar *description)
+{
+ g_free (self->priv->description);
+ self->priv->description = g_strdup (description);
+}
+
/**
* empathy_ft_handler_new_incoming:
* @channel: the #TpFileTransferChannel proxy to the incoming channel
@@ -1616,6 +1628,18 @@ empathy_ft_handler_get_filename (EmpathyFTHandler *handler)
return priv->filename;
}
+const char *
+empathy_ft_handler_get_description (EmpathyFTHandler *handler)
+{
+ EmpathyFTHandlerPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_FT_HANDLER (handler), NULL);
+
+ priv = handler->priv;
+
+ return priv->description;
+}
+
/**
* empathy_ft_handler_get_content_type:
* @handler: an #EmpathyFTHandler