]> git.0d.be Git - empathy.git/blobdiff - src/empathy.c
Fix conflict after rebase
[empathy.git] / src / empathy.c
index 1b3483fbac4bbc45a5333064ef2710e3747134e5..d5be4df8d4a7902dea53a3b50ef2395fda5512bb 100644 (file)
@@ -129,11 +129,18 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
 
                factory = empathy_call_factory_get ();
                empathy_call_factory_claim_channel (factory, operation);
-       } else if (channel_type == EMP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER) {
+       } else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER) {
                EmpathyFTFactory *factory;
 
                factory = empathy_ft_factory_dup_singleton ();
-               empathy_ft_factory_claim_channel (factory, operation);
+
+               /* if the operation is not incoming, don't claim it,
+                * as it might have been triggered by another client, and
+                * we are observing it.
+                */
+               if (empathy_dispatch_operation_is_incoming (operation)) {
+                       empathy_ft_factory_claim_channel (factory, operation);
+               }
        }
 }
 
@@ -407,20 +414,29 @@ show_version_cb (const char *option_name,
 static void
 new_incoming_transfer_cb (EmpathyFTFactory *factory,
                          EmpathyFTHandler *handler,
+                          GError *error,
                          gpointer user_data)
 {
-       empathy_receive_file_with_file_chooser (handler);
+       if (error) {
+               empathy_ft_manager_display_error (handler, error);
+       } else {
+               empathy_receive_file_with_file_chooser (handler);
+       }
 }
 
 static void
 new_ft_handler_cb (EmpathyFTFactory *factory,
                   EmpathyFTHandler *handler,
+                   GError *error,
                   gpointer user_data)
 {
-       EmpathyFTManager *ft_manager;
+       if (error) {
+               empathy_ft_manager_display_error (handler, error);
+       } else {
+               empathy_ft_manager_add_handler (handler);
+       }
 
-       ft_manager = empathy_ft_manager_dup_singleton ();
-       empathy_ft_manager_add_handler (ft_manager, handler);
+       g_object_unref (handler);
 }
 
 static void
@@ -444,7 +460,6 @@ main (int argc, char *argv[])
        EmpathyDispatcher *dispatcher;
        EmpathyLogManager *log_manager;
        EmpathyChatroomManager *chatroom_manager;
-       EmpathyFTManager  *ft_manager;
        EmpathyCallFactory *call_factory;
        EmpathyFTFactory  *ft_factory;
        GtkWidget         *window;
@@ -594,8 +609,6 @@ main (int argc, char *argv[])
        chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL);
        empathy_chatroom_manager_observe (chatroom_manager, dispatcher);
 
-       ft_manager = empathy_ft_manager_dup_singleton ();
-
        notify_init (_(PACKAGE_NAME));
        /* Create the call factory */
        call_factory = empathy_call_factory_initialise ();
@@ -623,7 +636,6 @@ main (int argc, char *argv[])
        g_object_unref (log_manager);
        g_object_unref (dispatcher);
        g_object_unref (chatroom_manager);
-       g_object_unref (ft_manager);
 #if HAVE_GEOCLUE
        g_object_unref (location_manager);
 #endif