diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-16 23:39:16 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-16 23:39:16 +0800 |
commit | bb8f274466fdbfe7a2fa1de312b84bd1def46a86 (patch) | |
tree | 1a3facaa3f3aee37bf8c86c8e14aa27f769d0ee6 /libempathy | |
parent | d2a148ae6624d47ecaf9461e545d4e8a4d67c162 (diff) | |
download | gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.tar gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.tar.gz gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.tar.bz2 gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.tar.lz gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.tar.xz gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.tar.zst gsoc2013-empathy-bb8f274466fdbfe7a2fa1de312b84bd1def46a86.zip |
Use tp_connection_call_when_ready
svn path=/trunk/; revision=1102
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-contact-list.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 9fb5c0402..d5fa9c3e2 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -610,19 +610,34 @@ tp_contact_list_finalize (GObject *object) } static void -tp_contact_list_ready_cb (EmpathyTpContactList *list) +tp_contact_list_connection_ready (TpConnection *connection, + const GError *error, + gpointer list) { EmpathyTpContactListPriv *priv = GET_PRIV (list); + if (error) { + tp_contact_list_invalidated_cb (connection, + error->domain, + error->code, + error->message, + EMPATHY_TP_CONTACT_LIST (list)); + return; + } + + g_signal_connect (priv->connection, "invalidated", + G_CALLBACK (tp_contact_list_invalidated_cb), + list); + tp_cli_connection_call_list_channels (priv->connection, -1, tp_contact_list_list_channels_cb, NULL, NULL, - G_OBJECT (list)); + list); tp_cli_connection_connect_to_new_channel (priv->connection, tp_contact_list_new_channel_cb, NULL, NULL, - G_OBJECT (list), NULL); + list, NULL); } static void @@ -644,17 +659,9 @@ tp_contact_list_constructed (GObject *list) g_return_if_fail (priv->connection != NULL); g_object_unref (mc); - g_signal_connect (priv->connection, "invalidated", - G_CALLBACK (tp_contact_list_invalidated_cb), - list); - g_object_get (priv->connection, "connection-ready", &ready, NULL); - if (ready) { - tp_contact_list_ready_cb (EMPATHY_TP_CONTACT_LIST (list)); - } else { - g_signal_connect_swapped (priv->connection, "notify::connection-ready", - G_CALLBACK (tp_contact_list_ready_cb), - list); - } + tp_connection_call_when_ready (priv->connection, + tp_contact_list_connection_ready, + list); /* Check for protocols that does not support contact groups. We can * put all contacts into a special group in that case. |