diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-02-16 05:28:11 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-04-22 18:21:08 +0800 |
commit | 155c6bfe659f017a9fda6c99caf71f3c2a63f92b (patch) | |
tree | 1cb1d0f2d03a078a6d26495bc0727ce3095783cd | |
parent | 9f02816a5589ccc2b8379a32007acca6d9bd9232 (diff) | |
download | gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.tar gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.tar.gz gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.tar.bz2 gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.tar.lz gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.tar.xz gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.tar.zst gsoc2013-empathy-155c6bfe659f017a9fda6c99caf71f3c2a63f92b.zip |
Port EmpathyContactDialogs to new API.
-rw-r--r-- | libempathy-gtk/empathy-contact-dialogs.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 72b5b28b3..309cd649c 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -30,6 +30,7 @@ #include <libmissioncontrol/mission-control.h> #include <libempathy/empathy-contact-manager.h> +#include <libempathy/empathy-account-manager.h> #include <libempathy/empathy-contact-list.h> #include <libempathy/empathy-utils.h> @@ -242,12 +243,23 @@ static gboolean can_add_contact_to_account (McAccount *account, gpointer user_data) { - EmpathyContactManager *mgr; + EmpathyAccountManager *account_manager; + EmpathyContactManager *contact_manager; + TpConnection *connection; gboolean result; - mgr = empathy_contact_manager_dup_singleton (); - result = empathy_contact_manager_can_add (mgr, account); - g_object_unref (mgr); + account_manager = empathy_account_manager_dup_singleton (); + connection = empathy_account_manager_get_connection (account_manager, + account); + if (!connection) { + g_object_unref (account_manager); + return FALSE; + } + + contact_manager = empathy_contact_manager_dup_singleton (); + result = empathy_contact_manager_can_add (contact_manager, connection); + g_object_unref (contact_manager); + g_object_unref (account_manager); return result; } |