aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-tp-file.c')
-rw-r--r--libempathy/empathy-tp-file.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index 3d2cedf79..38f54a386 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -332,11 +332,17 @@ tp_file_invalidated_cb (TpProxy *proxy,
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