aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy/empathy-contact-manager.c15
-rw-r--r--libempathy/empathy-contact-manager.h2
2 files changed, 17 insertions, 0 deletions
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