]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-dispatch-operation.c
empathy-tp-tube: remove initiator and type member variables as they are not used
[empathy.git] / libempathy / empathy-dispatch-operation.c
index 5619badaa79bcec9c5da569df453ff58d14f4d3f..1786e4169039c37a110ea3116c26613ef4782a91 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "empathy-marshal.h"
 
+#include "extensions/extensions.h"
+
 #define DEBUG_FLAG EMPATHY_DEBUG_DISPATCHER
 #include <libempathy/empathy-debug.h>
 
@@ -370,6 +372,10 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
   EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
   GQuark channel_type;
 
+  /* The error will be handled in empathy_dispatch_operation_invalidated */
+  if (error != NULL)
+    return;
+
   g_assert (channel == priv->channel);
 
   /* If the channel wrapper is defined, we assume it's ready */
@@ -387,7 +393,7 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
         {
           priv->ready_handler = g_signal_connect (chat, "notify::ready",
             G_CALLBACK (empathy_dispatcher_operation_tp_chat_ready_cb), self);
-          goto readying;
+          return;
         }
 
     }
@@ -397,7 +403,7 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
        priv->channel_wrapper = G_OBJECT (call);
 
     }
-  else if (channel_type == EMP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
+  else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
     {
        EmpathyTpFile *file = empathy_tp_file_new (channel);
        priv->channel_wrapper = G_OBJECT (file);
@@ -406,8 +412,6 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
 ready:
   empathy_dispatch_operation_set_status (self,
     EMPATHY_DISPATCHER_OPERATION_STATE_PENDING);
-readying:
-  return;
 }
 
 EmpathyDispatchOperation *
@@ -475,12 +479,18 @@ empathy_dispatch_operation_approve (EmpathyDispatchOperation *operation)
 
       g_signal_emit (operation, signals[APPROVED], 0);
     }
-  else
+  else if (priv->status < EMPATHY_DISPATCHER_OPERATION_STATE_APPROVING)
     {
       DEBUG ("Pre-approving operation %s",
         empathy_dispatch_operation_get_object_path (operation));
       priv->approved = TRUE;
     }
+  else
+    {
+      DEBUG (
+        "Ignoring approval for %s as it's already past the approval stage",
+        empathy_dispatch_operation_get_object_path (operation));
+    }
 }
 
 /* Returns whether or not the operation was successfully claimed */