empathy r1891 - trunk/libempathy



Author: xclaesse
Date: Fri Nov 21 16:23:46 2008
New Revision: 1891
URL: http://svn.gnome.org/viewvc/empathy?rev=1891&view=rev

Log:
Change state when the channel is invalidated only if an error occured.

Modified:
   trunk/libempathy/empathy-tp-file.c

Modified: trunk/libempathy/empathy-tp-file.c
==============================================================================
--- trunk/libempathy/empathy-tp-file.c	(original)
+++ trunk/libempathy/empathy-tp-file.c	Fri Nov 21 16:23:46 2008
@@ -332,11 +332,17 @@
 			gchar         *message,
 			EmpathyTpFile *tp_file)
 {
-	DEBUG ("Channel invalidated: %s", message);
-	tp_file->priv->state = EMP_FILE_TRANSFER_STATE_CANCELLED;
-	tp_file->priv->state_change_reason =
-	    EMP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR;
-	g_object_notify (G_OBJECT (tp_file), "state");
+  DEBUG ("Channel invalidated: %s", message);
+
+  if (tp_file->priv->state != EMP_FILE_TRANSFER_STATE_COMPLETED &&
+      tp_file->priv->state != EMP_FILE_TRANSFER_STATE_CANCELLED)
+    {
+      /* The channel is not in a finished state, an error occured */
+      tp_file->priv->state = EMP_FILE_TRANSFER_STATE_CANCELLED;
+      tp_file->priv->state_change_reason =
+          EMP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR;
+      g_object_notify (G_OBJECT (tp_file), "state");
+    }
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]