[Telepathy-commits] [telepathy-salut/master] Connect to the canceled signal in the file channel and change the transfer state appropriately.

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Nov 21 03:46:16 PST 2008


20080805111138-8ed0e-54a4c870b5666c65c00f40902484380bc06ace61.gz
---
 src/salut-file-channel.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/salut-file-channel.c b/src/salut-file-channel.c
index ffaaef7..ef20856 100644
--- a/src/salut-file-channel.c
+++ b/src/salut-file-channel.c
@@ -941,6 +941,18 @@ ft_transferred_chunk_cb (GibberFileTransfer *ft, guint64 count, SalutFileChannel
     }
 }
 
+static void
+ft_remote_canceled_cb (GibberFileTransfer *ft,
+                       SalutFileChannel *self)
+{
+  salut_file_channel_set_state (SALUT_SVC_CHANNEL_TYPE_FILE (self),
+                                SALUT_FILE_TRANSFER_STATE_CANCELED,
+                                SALUT_FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_STOPPED);
+
+  salut_xmpp_connection_manager_release_connection (self->priv->xmpp_connection_manager,
+                                                    self->priv->xmpp_connection);
+}
+
 /**
  * salut_file_channel_accept_file
  *
@@ -984,6 +996,7 @@ salut_file_channel_accept_file (SalutSvcChannelTypeFile *iface,
 
   g_signal_connect (ft, "finished", G_CALLBACK (ft_finished_cb), self);
   g_signal_connect (ft, "transferred-chunk", G_CALLBACK (ft_transferred_chunk_cb), self);
+  g_signal_connect (ft, "canceled", G_CALLBACK (ft_remote_canceled_cb), self);
 
   setup_local_socket (self);
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list