]> git.0d.be Git - empathy.git/commitdiff
Implement empathy_ft_factory_claim_channel and make naming uniform.
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>
Thu, 5 Feb 2009 14:26:08 +0000 (15:26 +0100)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 1 Jun 2009 15:46:04 +0000 (17:46 +0200)
libempathy/empathy-ft-factory.c
libempathy/empathy-ft-factory.h

index 038e592ec5326644e0f63895403bef6d4181f99c..c76ff2d6121d34da7ad2b1110da3223d6a050a23 100644 (file)
@@ -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);
 }
 
index d838499f614ac2458b7514d6e20cc59ffec53a6b..745d1520e1228fba563a86db942fc165836e20b7 100644 (file)
@@ -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