return NULL;
}
-GList *
-empathy_contact_list_get_all_groups (EmpathyContactList *list)
-{
- g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST (list), NULL);
-
- if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_all_groups) {
- return EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_all_groups (list);
- }
-
- return NULL;
-}
-
GList *
empathy_contact_list_get_groups (EmpathyContactList *list,
EmpathyContact *contact)
const gchar *message);
GList * (*get_members) (EmpathyContactList *list);
GList * (*get_pendings) (EmpathyContactList *list);
- GList * (*get_all_groups) (EmpathyContactList *list);
GList * (*get_groups) (EmpathyContactList *list,
EmpathyContact *contact);
void (*add_to_group) (EmpathyContactList *list,
const gchar *message);
GList * empathy_contact_list_get_members (EmpathyContactList *list);
GList * empathy_contact_list_get_pendings (EmpathyContactList *list);
-GList * empathy_contact_list_get_all_groups (EmpathyContactList *list);
GList * empathy_contact_list_get_groups (EmpathyContactList *list,
EmpathyContact *contact);
void empathy_contact_list_add_to_group (EmpathyContactList *list,
return contacts;
}
-static void
-contact_manager_get_all_groups_foreach (TpConnection *connection,
- EmpathyTpContactList *list,
- GList **all_groups)
-{
- GList *groups, *l;
-
- groups = empathy_contact_list_get_all_groups (EMPATHY_CONTACT_LIST (list));
- for (l = groups; l; l = l->next) {
- if (!g_list_find_custom (*all_groups,
- l->data,
- (GCompareFunc) strcmp)) {
- *all_groups = g_list_prepend (*all_groups, l->data);
- } else {
- g_free (l->data);
- }
- }
-
- g_list_free (groups);
-}
-
-static GList *
-contact_manager_get_all_groups (EmpathyContactList *manager)
-{
- EmpathyContactManagerPriv *priv = GET_PRIV (manager);
- GList *groups = NULL;
-
- g_return_val_if_fail (EMPATHY_IS_CONTACT_MANAGER (manager), NULL);
-
- g_hash_table_foreach (priv->lists,
- (GHFunc) contact_manager_get_all_groups_foreach,
- &groups);
-
- return groups;
-}
-
static GList *
contact_manager_get_groups (EmpathyContactList *manager,
EmpathyContact *contact)
iface->remove = contact_manager_remove;
iface->get_members = contact_manager_get_members;
iface->get_pendings = contact_manager_get_pendings;
- iface->get_all_groups = contact_manager_get_all_groups;
iface->get_groups = contact_manager_get_groups;
iface->add_to_group = contact_manager_add_to_group;
iface->remove_from_group = contact_manager_remove_from_group;
return ret;
}
-static GList *
-tp_contact_list_get_all_groups (EmpathyContactList *list)
-{
- EmpathyTpContactListPriv *priv = GET_PRIV (list);
- GList *ret, *l;
-
- ret = g_hash_table_get_keys (priv->groups);
- for (l = ret; l; l = l->next) {
- l->data = g_strdup (l->data);
- }
-
- return ret;
-}
-
static GList *
tp_contact_list_get_groups (EmpathyContactList *list,
EmpathyContact *contact)
iface->remove = tp_contact_list_remove;
iface->get_members = tp_contact_list_get_members;
iface->get_pendings = tp_contact_list_get_pendings;
- iface->get_all_groups = tp_contact_list_get_all_groups;
iface->get_groups = tp_contact_list_get_groups;
iface->add_to_group = tp_contact_list_add_to_group;
iface->remove_from_group = tp_contact_list_remove_from_group;