From a5bbfafd202f1d2e2019650481075c798cab9bfd Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 12 Dec 2008 09:40:21 +0000 Subject: add empathy_contact_manager_can_add (Guillaume Desmottes) svn path=/trunk/; revision=1962 --- libempathy/empathy-contact-manager.c | 15 +++++++++++++++ libempathy/empathy-contact-manager.h | 2 ++ 2 files changed, 17 insertions(+) (limited to 'libempathy') diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c index 48ac1598b..200f9ea37 100644 --- a/libempathy/empathy-contact-manager.c +++ b/libempathy/empathy-contact-manager.c @@ -507,3 +507,18 @@ contact_manager_iface_init (EmpathyContactListIface *iface) iface->remove_group = contact_manager_remove_group; } +gboolean +empathy_contact_manager_can_add (EmpathyContactManager *manager, + McAccount *account) +{ + EmpathyContactManagerPriv *priv = GET_PRIV (manager); + EmpathyTpContactList *list; + + g_return_val_if_fail (EMPATHY_IS_CONTACT_MANAGER (manager), FALSE); + + list = g_hash_table_lookup (priv->lists, account); + if (list == NULL) + return FALSE; + + return empathy_tp_contact_list_can_add (list); +} diff --git a/libempathy/empathy-contact-manager.h b/libempathy/empathy-contact-manager.h index b744b44e4..80118a014 100644 --- a/libempathy/empathy-contact-manager.h +++ b/libempathy/empathy-contact-manager.h @@ -55,6 +55,8 @@ GType empathy_contact_manager_get_type (void) G_GNUC_CONST; EmpathyContactManager *empathy_contact_manager_new (void); EmpathyTpContactList * empathy_contact_manager_get_list (EmpathyContactManager *manager, McAccount *account); +gboolean empathy_contact_manager_can_add (EmpathyContactManager *manager, + McAccount *account); G_END_DECLS -- cgit v1.2.3