aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-dialogs.c
diff options
context:
space:
mode:
authorVitaly Minko <vitaly.minko@gmail.com>2010-11-11 01:23:39 +0800
committerVitaly Minko <vitaly.minko@gmail.com>2010-11-11 01:23:39 +0800
commit18d649cbfd8eda7678957a3d2a76b9bb8681a981 (patch)
treec3798b5507f8bf2102d3bd6c94922a21e40c17a8 /libempathy-gtk/empathy-contact-dialogs.c
parentc6cd722328a112e8f4b015ca57ffe8dc72f50cd8 (diff)
downloadgsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.tar
gsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.tar.gz
gsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.tar.bz2
gsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.tar.lz
gsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.tar.xz
gsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.tar.zst
gsoc2013-empathy-18d649cbfd8eda7678957a3d2a76b9bb8681a981.zip
Make AccountChooser filters asynchronous to let them handle newly connected accounts properly (#633481).
Diffstat (limited to 'libempathy-gtk/empathy-contact-dialogs.c')
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index a5ae51d03..fb57f348b 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -354,24 +354,28 @@ empathy_contact_personal_dialog_show (GtkWindow *parent)
* New contact dialog
*/
-static gboolean
-can_add_contact_to_account (TpAccount *account,
- gpointer user_data)
+static void
+can_add_contact_to_account (TpAccount *account,
+ EmpathyAccountChooserFilterResultCallback callback,
+ gpointer callback_data,
+ gpointer user_data)
{
EmpathyContactManager *contact_manager;
TpConnection *connection;
gboolean result;
connection = tp_account_get_connection (account);
- if (connection == NULL)
- return FALSE;
+ if (connection == NULL) {
+ callback (FALSE, callback_data);
+ return;
+ }
contact_manager = empathy_contact_manager_dup_singleton ();
result = empathy_contact_manager_get_flags_for_connection (
contact_manager, connection) & EMPATHY_CONTACT_LIST_CAN_ADD;
g_object_unref (contact_manager);
- return result;
+ callback (result, callback_data);
}
static void