diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-02-08 09:16:15 +0800 |
---|---|---|
committer | Chandni Verma <chandniverma2112@gmail.com> | 2011-03-08 08:56:51 +0800 |
commit | ac5479e2ab5b1291afd853892238b0eb22c6e345 (patch) | |
tree | f51a895fc5565895b10265b66a3faab6264847d8 /libempathy-gtk/empathy-contact-blocking-dialog.c | |
parent | 65bf3f42d6699ce32edccab2412dabe195eac68d (diff) | |
download | gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.tar gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.tar.gz gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.tar.bz2 gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.tar.lz gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.tar.xz gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.tar.zst gsoc2013-empathy-ac5479e2ab5b1291afd853892238b0eb22c6e345.zip |
Don't need to prepare accounts separately
Diffstat (limited to 'libempathy-gtk/empathy-contact-blocking-dialog.c')
-rw-r--r-- | libempathy-gtk/empathy-contact-blocking-dialog.c | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/libempathy-gtk/empathy-contact-blocking-dialog.c b/libempathy-gtk/empathy-contact-blocking-dialog.c index 5cb3d4e76..c378db3f6 100644 --- a/libempathy-gtk/empathy-contact-blocking-dialog.c +++ b/libempathy-gtk/empathy-contact-blocking-dialog.c @@ -223,7 +223,7 @@ contact_blocking_dialog_deny_channel_members_changed (TpChannel *channel, tp_intset_destroy (removed_set); } -DECLARE_CALLBACK (contact_blocking_dialog_account_prepared); +DECLARE_CALLBACK (contact_blocking_dialog_connection_prepared); static void contact_blocking_dialog_am_prepared (GObject *am, @@ -246,40 +246,21 @@ contact_blocking_dialog_am_prepared (GObject *am, for (ptr = accounts; ptr != NULL; ptr = ptr->next) { TpAccount *account = ptr->data; + TpConnection *conn; - tp_proxy_prepare_async (account, NULL, - contact_blocking_dialog_account_prepared, self); - } - - g_list_free (accounts); -} + g_signal_connect (account, "status-changed", + G_CALLBACK (contact_blocking_dialog_connection_status_changed), self); -static void -contact_blocking_dialog_account_prepared (GObject *account, - GAsyncResult *result, - gpointer user_data) -{ - EmpathyContactBlockingDialog *self = user_data; - TpConnection *conn; - GError *error = NULL; + conn = tp_account_get_connection (TP_ACCOUNT (account)); - if (!tp_proxy_prepare_finish (account, result, &error)) - { - DEBUG ("Could not prepare Account: %s", error->message); - g_error_free (error); - return; + if (conn != NULL) + { + tp_proxy_prepare_async (conn, NULL, + contact_blocking_dialog_connection_prepared, self); + } } - g_signal_connect (account, "status-changed", - G_CALLBACK (contact_blocking_dialog_connection_status_changed), self); - - conn = tp_account_get_connection (TP_ACCOUNT (account)); - - if (conn != NULL) - { - tp_proxy_prepare_async (conn, NULL, - contact_blocking_dialog_connection_prepared, self); - } + g_list_free (accounts); } static void contact_blocking_dialog_got_deny_channel (TpConnection *, |