[empathy: 7/148] Implement empathy_ft_factory_claim_channel and make naming uniform.



commit aab63c16b9ded12295e0fa354757c77b002a6fbd
Author: Cosimo Cecchi <cosimo cecchi collabora co uk>
Date:   Thu Feb 5 15:26:08 2009 +0100

    Implement empathy_ft_factory_claim_channel and make naming uniform.
---
 libempathy/empathy-ft-factory.c |   23 ++++++++++++++++++-----
 libempathy/empathy-ft-factory.h |    4 ++--
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c
index 038e592..c76ff2d 100644
--- a/libempathy/empathy-ft-factory.c
+++ b/libempathy/empathy-ft-factory.c
@@ -124,15 +124,15 @@ empathy_ft_factory_dup_singleton (void)
 void
 empathy_ft_factory_new_transfer (EmpathyFTFactory *factory,
                                  EmpathyContact *contact,
-                                 GFile *file)
+                                 GFile *source)
 {
   EmpathyFTHandler *handler;
 
   g_return_if_fail (EMPATHY_IS_FT_FACTORY (factory));
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
-  g_return_if_fail (G_IS_FILE (file));
+  g_return_if_fail (G_IS_FILE (source));
 
-  handler = empathy_ft_handler_new_outgoing (contact, file);
+  handler = empathy_ft_handler_new_outgoing (contact, source);
   g_signal_emit (factory, signals[NEW_FT_HANDLER], 0, handler, TRUE);
 
   g_object_unref (handler);
@@ -140,11 +140,24 @@ empathy_ft_factory_new_transfer (EmpathyFTFactory *factory,
 
 void
 empathy_ft_factory_claim_channel (EmpathyFTFactory *factory,
-                                  EmpathyDispatchOperation *operation)
+                                  EmpathyDispatchOperation *operation,
+                                  GFile *destination)
 {
+  EmpathyFTHandler *handler;
+  EmpathyTpFile *tp_file;
+
   g_return_if_fail (EMPATHY_IS_FT_FACTORY (factory));
   g_return_if_fail (EMPATHY_IS_DISPATCH_OPERATION (operation));
+  g_return_if_fail (G_IS_FILE (destination));
+
+  tp_file = EMPATHY_TP_FILE
+      (empathy_dispatch_operation_get_channel_wrapper (operation));
+  handler = empathy_ft_handler_new_incoming (tp_file, destination);
 
-  /* TODO */
+  empathy_dispatch_operation_claim (operation);
+
+  g_signal_emit (factory, signals[NEW_FT_HANDLER], 0, handler, FALSE);
+
+  g_object_unref (handler);
 }
 
diff --git a/libempathy/empathy-ft-factory.h b/libempathy/empathy-ft-factory.h
index d838499..745d152 100644
--- a/libempathy/empathy-ft-factory.h
+++ b/libempathy/empathy-ft-factory.h
@@ -58,9 +58,9 @@ GType empathy_ft_factory_get_type (void);
 /* public methods */
 EmpathyFTFactory* empathy_ft_factory_dup_singleton (void);
 void              empathy_ft_factory_new_transfer (EmpathyFTFactory *factory,
-  EmpathyContact *contact, GFile *file);
+  EmpathyContact *contact, GFile *source);
 void              empathy_ft_factory_claim_channel (EmpathyFTFactory *factory,
-  EmpathyDispatchOperation *operation);
+  EmpathyDispatchOperation *operation, GFile *destination);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]