aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-file.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2008-11-22 00:17:03 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:17:03 +0800
commitbc82fc3c32d04bbef0f1921fe8f534cfac345f8d (patch)
treeccd1880d566b2ed76ed6af29592143251e8b1389 /libempathy/empathy-tp-file.c
parent7cb242a20728f515058468cbc3ffab111785f53e (diff)
downloadgsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.tar
gsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.tar.gz
gsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.tar.bz2
gsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.tar.lz
gsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.tar.xz
gsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.tar.zst
gsoc2013-empathy-bc82fc3c32d04bbef0f1921fe8f534cfac345f8d.zip
Added empathy_offer_file function and updated accept_file. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=1788
Diffstat (limited to 'libempathy/empathy-tp-file.c')
-rw-r--r--libempathy/empathy-tp-file.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index c64c0e2f8..0d1a47a39 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -621,7 +621,8 @@ _get_local_socket (EmpathyTpFile *tp_file)
* EMP_FILE_TRANSFER_STATE_LOCAL_PENDING).
*/
void
-empathy_tp_file_accept (EmpathyTpFile *tp_file)
+empathy_tp_file_accept (EmpathyTpFile *tp_file,
+ guint64 offset)
{
EmpathyTpFilePriv *priv;
GValue *address;
@@ -641,11 +642,46 @@ empathy_tp_file_accept (EmpathyTpFile *tp_file)
if (!emp_cli_channel_type_file_run_accept_file (TP_PROXY (priv->channel),
-1, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST,
- &nothing, &address, &error, NULL))
+ &nothing, offset, &address, &error, NULL))
{
DEBUG ("Accept error: %s",
error ? error->message : "No message given");
g_clear_error (&error);
+ return;
+ }
+
+ if (priv->unix_socket_path)
+ g_free (priv->unix_socket_path);
+
+ priv->unix_socket_path = g_value_dup_string (address);
+ g_value_unset (address);
+
+ DEBUG ("Got unix socket path: %s", priv->unix_socket_path);
+}
+
+void
+empathy_tp_file_offer (EmpathyTpFile *tp_file)
+{
+ EmpathyTpFilePriv *priv;
+ GValue *address;
+ GError *error = NULL;
+ GValue nothing = { 0 };
+
+ g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
+
+ priv = GET_PRIV (tp_file);
+
+ g_value_init (&nothing, G_TYPE_STRING);
+ g_value_set_string (&nothing, "");
+
+ if (!emp_cli_channel_type_file_run_offer_file (TP_PROXY (priv->channel),
+ -1, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST,
+ &nothing, &address, &error, NULL))
+ {
+ DEBUG ("OfferFile error: %s",
+ error ? error->message : "No message given");
+ g_clear_error (&error);
+ return;
}
if (priv->unix_socket_path)