]> git.0d.be Git - empathy.git/commitdiff
Fix coding style and cleanup
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 21 Nov 2008 16:22:58 +0000 (16:22 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 21 Nov 2008 16:22:58 +0000 (16:22 +0000)
svn path=/trunk/; revision=1880

src/empathy.c

index 92be3239e8a4610ec76dc30ea686d69e57568765..869d148802e8050b475684b98c2b8343ef9edf75 100644 (file)
 
 static BaconMessageConnection *connection = NULL;
 
-static void
-file_channel_add_to_file_manager (TpChannel *channel)
-{
-       EmpathyTpFile *tp_file;
-       EmpathyFTManager *ft_manager;
-
-       ft_manager = empathy_ft_manager_get_default ();
-       tp_file = empathy_tp_file_new (channel);
-       empathy_ft_manager_add_tp_file (ft_manager, tp_file);
-
-       g_object_unref (channel);
-}
-
 static void
 file_channel_get_state_cb (TpProxy      *proxy,
                           const GValue *state_value,
@@ -80,14 +67,18 @@ file_channel_get_state_cb (TpProxy      *proxy,
                           gpointer      user_data,
                           GObject      *weak_object)
 {
+       EmpathyTpFile *tp_file;
+       EmpathyFTManager *ft_manager;
        EmpFileTransferState state;
-       state = g_value_get_uint (state_value);
 
-       if (state == EMP_FILE_TRANSFER_STATE_PENDING)
-  {
-               file_channel_add_to_file_manager (TP_CHANNEL (proxy));
+       state = g_value_get_uint (state_value);
+       if (state != EMP_FILE_TRANSFER_STATE_PENDING) {
                return;
        }
+
+       ft_manager = empathy_ft_manager_get_default ();
+       tp_file = empathy_tp_file_new (TP_CHANNEL (proxy));
+       empathy_ft_manager_add_tp_file (ft_manager, tp_file);
 }
 
 static void
@@ -136,7 +127,7 @@ dispatch_channel_cb (EmpathyDispatcher *dispatcher,
                empathy_call_window_new (channel);
        }
        else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_FILE_TRANSFER)) {
-               tp_cli_dbus_properties_call_get (g_object_ref (channel), -1,
+               tp_cli_dbus_properties_call_get (channel, -1,
                        EMP_IFACE_CHANNEL_TYPE_FILE_TRANSFER,
                        "State", file_channel_get_state_cb,
                        NULL, NULL, NULL);