aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact-list.c
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-03-06 09:45:44 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-15 16:28:40 +0800
commit79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9 (patch)
treec87f0c760ab4d8b4c02963a284ad9dc75e7f722c /libempathy/empathy-contact-list.c
parent50a0138f16ceabeecd1ee92f127684a9d50b3e70 (diff)
downloadgsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.tar
gsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.tar.gz
gsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.tar.bz2
gsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.tar.lz
gsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.tar.xz
gsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.tar.zst
gsoc2013-empathy-79ef79c4d92cc4978dd12528d5bb6c3673a6b0f9.zip
Cut out the concept of a special Favourites group
Diffstat (limited to 'libempathy/empathy-contact-list.c')
-rw-r--r--libempathy/empathy-contact-list.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/libempathy/empathy-contact-list.c b/libempathy/empathy-contact-list.c
index a46fc8db4..611a40fe5 100644
--- a/libempathy/empathy-contact-list.c
+++ b/libempathy/empathy-contact-list.c
@@ -250,21 +250,42 @@ empathy_contact_list_get_flags (EmpathyContactList *list)
}
}
-/* XXX: this should be an EmpathyContact function, but it would likely require
- * some awkward refactoring */
gboolean
-empathy_contact_list_contact_is_favourite (EmpathyContactList *list,
- EmpathyContact *contact)
+empathy_contact_list_is_favourite (EmpathyContactList *list,
+ EmpathyContact *contact)
{
#if HAVE_FAVOURITE_CONTACTS
- GList *groups, *l;
-
- groups = empathy_contact_list_get_groups (list, contact);
- for (l = groups; l; l = l->next)
- if (!g_strcmp0 (l->data, EMPATHY_GROUP_FAVOURITES))
- return TRUE;
+ if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->is_favourite) {
+ return EMPATHY_CONTACT_LIST_GET_IFACE (list)->is_favourite (
+ list, contact);
+ }
#endif /* HAVE_FAVOURITE_CONTACTS */
return FALSE;
}
+void
+empathy_contact_list_add_to_favourites (EmpathyContactList *list,
+ EmpathyContact *contact)
+{
+#if HAVE_FAVOURITE_CONTACTS
+ if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->add_favourite) {
+ EMPATHY_CONTACT_LIST_GET_IFACE (list)->add_favourite (list,
+ contact);
+ }
+#endif /* HAVE_FAVOURITE_CONTACTS */
+}
+
+void
+empathy_contact_list_remove_from_favourites (EmpathyContactList *list,
+ EmpathyContact *contact)
+{
+#if HAVE_FAVOURITE_CONTACTS
+ if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->remove_favourite) {
+ EMPATHY_CONTACT_LIST_GET_IFACE (list)->remove_favourite (list,
+ contact);
+ }
+#endif /* HAVE_FAVOURITE_CONTACTS */
+}
+
+