]> git.0d.be Git - empathy.git/commitdiff
client-factory: stop creating EmpathyTpFile objects
authorJonny Lamb <jonny.lamb@collabora.co.uk>
Wed, 9 Nov 2011 10:54:03 +0000 (10:54 +0000)
committerJonny Lamb <jonny.lamb@collabora.co.uk>
Wed, 9 Nov 2011 10:54:03 +0000 (10:54 +0000)
TpAutomaticClientFactory will create TpFileTransferChannels for us and
they're, like, way better.

Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
libempathy/empathy-client-factory.c
libempathy/empathy-ft-factory.c
nautilus-sendto-plugin/empathy-nautilus-sendto.c
src/empathy-event-manager.c
src/empathy-ft-manager.c

index f7529bf2e590177e98dbe2d30ddd4d5e918cb343..3794ef60d237d375e25861160e14807664630e92 100644 (file)
@@ -24,7 +24,6 @@
 #include "empathy-client-factory.h"
 
 #include "empathy-tp-chat.h"
-#include "empathy-tp-file.h"
 #include "empathy-utils.h"
 
 #include <telepathy-yell/telepathy-yell.h>
@@ -89,11 +88,6 @@ empathy_client_factory_create_channel (TpSimpleClientFactory *factory,
       return TP_CHANNEL (call_channel_new_with_factory (
             TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error));
     }
-  else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER))
-    {
-      return TP_CHANNEL (empathy_tp_file_new (
-            TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error));
-    }
 
   return chainup->create_channel (factory, conn, path, properties, error);
 }
index fa52ce1aae62da835641e52d9dd6b1933d14f2e5..10c8bea086d76b75bd040ce45da55ff80546a199 100644 (file)
@@ -182,7 +182,7 @@ handle_channels_cb (TpSimpleHandler *handler,
       if (tp_proxy_get_invalidated (channel) != NULL)
         continue;
 
-      if (!EMPATHY_IS_TP_FILE (channel))
+      if (!TP_IS_FILE_TRANSFER_CHANNEL (channel))
         continue;
 
       /* We handle only incoming FT */
index 2f38b8325470a34d8797890e0085924b99fead97..ee1519de334091a4b7d80beb39ecdf743e3d90b0 100644 (file)
@@ -33,7 +33,6 @@
 #include <libempathy/empathy-debug.h>
 #include <libempathy/empathy-ft-factory.h>
 #include <libempathy/empathy-ft-handler.h>
-#include <libempathy/empathy-tp-file.h>
 
 #include <libempathy-gtk/empathy-contact-chooser.h>
 #include <libempathy-gtk/empathy-ui-utils.h>
@@ -166,7 +165,7 @@ quit (void)
 
 static void
 transfer_done_cb (EmpathyFTHandler *handler,
-                  EmpathyTpFile *tp_file,
+                  TpFileTransferChannel *channel,
                   NstPlugin *plugin)
 {
   quit ();
index da677d42d7f5b4e8579d460ac1dfdc92e634c0cc..c42b82821d26639bdbbd0fb7413ae374f97b9c84 100644 (file)
@@ -36,7 +36,6 @@
 #include <libempathy/empathy-contact-manager.h>
 #include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-tp-streamed-media.h>
-#include <libempathy/empathy-tp-file.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-gsettings.h>
 
@@ -422,9 +421,9 @@ reject_channel_claim_cb (GObject *source,
     {
       empathy_tp_chat_leave (user_data, "");
     }
-  else if (EMPATHY_IS_TP_FILE (user_data))
+  else if (TP_IS_FILE_TRANSFER_CHANNEL (user_data))
     {
-      empathy_tp_file_close (user_data);
+      tp_channel_close_async (user_data, NULL, NULL);
     }
 
 out:
@@ -1115,7 +1114,7 @@ approve_channels (TpSimpleApprover *approver,
         event_manager_call_channel_got_contact_cb,
         approval, NULL, G_OBJECT (self));
     }
-  else if (EMPATHY_IS_TP_FILE (channel))
+  else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
     {
       TpHandle handle;
 
index 5d2f659f2ec85573d655ac491d9a16854dff0e40..bc15262a1b3f7bc63b0cee98cc86db7a8bc17bd0 100644 (file)
@@ -37,7 +37,6 @@
 
 #define DEBUG_FLAG EMPATHY_DEBUG_FT
 #include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-tp-file.h>
 #include <libempathy/empathy-utils.h>
 
 #include <libempathy-gtk/empathy-ui-utils.h>
@@ -518,7 +517,7 @@ do_real_transfer_done (EmpathyFTManager *manager,
 
 static void
 ft_handler_transfer_done_cb (EmpathyFTHandler *handler,
-                             EmpathyTpFile *tp_file,
+                             TpFileTransferChannel *channel,
                              EmpathyFTManager *manager)
 {
   if (empathy_ft_handler_is_incoming (handler) &&
@@ -574,7 +573,7 @@ ft_handler_transfer_progress_cb (EmpathyFTHandler *handler,
 
 static void
 ft_handler_transfer_started_cb (EmpathyFTHandler *handler,
-                                EmpathyTpFile *tp_file,
+                                TpFileTransferChannel *channel,
                                 EmpathyFTManager *manager)
 {
   guint64 transferred_bytes, total_bytes;