From b8657a61fe72be0da2d91325b0851dd4d7fd533c Mon Sep 17 00:00:00 2001 From: Travis Reitter Date: Tue, 16 Feb 2010 10:11:43 -0800 Subject: Add support for marking contacts as favorites (which gives them a highlighted star next to their name and adds them to the top of the contact list) --- libempathy/empathy-contact-list.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libempathy/empathy-contact-list.c') diff --git a/libempathy/empathy-contact-list.c b/libempathy/empathy-contact-list.c index d4859210a..65a1edeec 100644 --- a/libempathy/empathy-contact-list.c +++ b/libempathy/empathy-contact-list.c @@ -249,3 +249,20 @@ empathy_contact_list_get_flags (EmpathyContactList *list) return 0; } } + +/* 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) +{ + 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; + + return FALSE; +} + -- cgit v1.2.3