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);
+ }
}
}
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
EmpathyDispatcher *dispatcher;
EmpathyLogManager *log_manager;
EmpathyChatroomManager *chatroom_manager;
- EmpathyFTManager *ft_manager;
EmpathyCallFactory *call_factory;
EmpathyFTFactory *ft_factory;
GtkWidget *window;
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 ();
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