]> git.0d.be Git - empathy.git/commitdiff
Make use of mission_control_get_tpconnection()
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 11 Apr 2008 13:10:22 +0000 (13:10 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 11 Apr 2008 13:10:22 +0000 (13:10 +0000)
svn path=/trunk/; revision=888

libempathy/empathy-tp-chat.c
libempathy/empathy-tp-contact-factory.c

index 7068d6074b1da1820ac1bf7c36ac2cb70f16c223..74ae2e4ba6f168d545ba4b3847dc80fe2850f8f7 100644 (file)
@@ -101,15 +101,7 @@ tp_chat_invalidated_cb (TpProxy       *proxy,
                        gchar         *message,
                        EmpathyTpChat *chat)
 {
                        gchar         *message,
                        EmpathyTpChat *chat)
 {
-       EmpathyTpChatPriv *priv = GET_PRIV (chat);
-
        empathy_debug (DEBUG_DOMAIN, "Channel invalidated: %s", message);
        empathy_debug (DEBUG_DOMAIN, "Channel invalidated: %s", message);
-
-       g_object_unref (priv->channel);
-       g_object_unref (priv->tp_chan);
-       priv->channel = NULL;
-       priv->tp_chan = NULL;
-
        g_signal_emit (chat, signals[DESTROY], 0);
 }
 
        g_signal_emit (chat, signals[DESTROY], 0);
 }
 
@@ -921,7 +913,6 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
        object_class->get_property = tp_chat_get_property;
        object_class->set_property = tp_chat_set_property;
 
        object_class->get_property = tp_chat_get_property;
        object_class->set_property = tp_chat_set_property;
 
-       /* Construct properties */
        g_object_class_install_property (object_class,
                                         PROP_ACCOUNT,
                                         g_param_spec_object ("account",
        g_object_class_install_property (object_class,
                                         PROP_ACCOUNT,
                                         g_param_spec_object ("account",
@@ -954,6 +945,7 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
                                                               FALSE,
                                                               G_PARAM_READWRITE |
                                                               G_PARAM_CONSTRUCT));
                                                               FALSE,
                                                               G_PARAM_READWRITE |
                                                               G_PARAM_CONSTRUCT));
+
        g_object_class_install_property (object_class,
                                         PROP_REMOTE_CONTACT,
                                         g_param_spec_object ("remote-contact",
        g_object_class_install_property (object_class,
                                         PROP_REMOTE_CONTACT,
                                         g_param_spec_object ("remote-contact",
@@ -965,7 +957,7 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
                                         PROP_READY,
                                         g_param_spec_boolean ("ready",
                                                               "Is the object ready",
                                         PROP_READY,
                                         g_param_spec_boolean ("ready",
                                                               "Is the object ready",
-                                                              "This object is can't be used until this becomes true",
+                                                              "This object can't be used until this becomes true",
                                                               FALSE,
                                                               G_PARAM_READABLE));
 
                                                               FALSE,
                                                               G_PARAM_READABLE));
 
@@ -1045,11 +1037,9 @@ empathy_tp_chat_new (McAccount *account,
        TpChannel      *channel;
        TpConnection   *connection;
        MissionControl *mc;
        TpChannel      *channel;
        TpConnection   *connection;
        MissionControl *mc;
-       TpConn         *tp_conn;
 
        mc = empathy_mission_control_new ();
 
        mc = empathy_mission_control_new ();
-       tp_conn = mission_control_get_connection (mc, account, NULL);
-       connection = tp_conn_dup_connection (tp_conn);
+       connection = mission_control_get_tpconnection (mc, account, NULL);
        channel = tp_chan_dup_channel (tp_chan, connection, NULL);
 
        chat = g_object_new (EMPATHY_TYPE_TP_CHAT, 
        channel = tp_chan_dup_channel (tp_chan, connection, NULL);
 
        chat = g_object_new (EMPATHY_TYPE_TP_CHAT, 
@@ -1060,7 +1050,6 @@ empathy_tp_chat_new (McAccount *account,
                             NULL);
 
        g_object_unref (channel);
                             NULL);
 
        g_object_unref (channel);
-       g_object_unref (tp_conn);
        g_object_unref (connection);
        g_object_unref (mc);
 
        g_object_unref (connection);
        g_object_unref (mc);
 
index 66be902707fd7aaeec2b1b23bdf50e52b38f567b..91a4a83a7ab696b987da523250d6632189a2b434 100644 (file)
@@ -833,7 +833,6 @@ static void
 tp_contact_factory_status_updated (EmpathyTpContactFactory *tp_factory)
 {
        EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory);
 tp_contact_factory_status_updated (EmpathyTpContactFactory *tp_factory)
 {
        EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory);
-       TpConn                      *tp_conn;
        gboolean                     connection_ready;
 
        if (priv->connection) {
        gboolean                     connection_ready;
 
        if (priv->connection) {
@@ -841,15 +840,12 @@ tp_contact_factory_status_updated (EmpathyTpContactFactory *tp_factory)
                return;
        }
 
                return;
        }
 
-       tp_conn = mission_control_get_connection (priv->mc, priv->account, NULL);
-       if (!tp_conn) {
+       priv->connection = mission_control_get_tpconnection (priv->mc, priv->account, NULL);
+       if (!priv->connection) {
                return;
        }
 
        /* We got a new connection, wait for it to be ready */
                return;
        }
 
        /* We got a new connection, wait for it to be ready */
-       priv->connection = tp_conn_dup_connection (tp_conn);
-       g_object_unref (tp_conn);
-
        g_signal_connect_swapped (priv->connection, "invalidated",
                                  G_CALLBACK (tp_contact_factory_connection_invalidated_cb),
                                  tp_factory);
        g_signal_connect_swapped (priv->connection, "invalidated",
                                  G_CALLBACK (tp_contact_factory_connection_invalidated_cb),
                                  tp_factory);