diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-06-12 20:11:32 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-06-14 15:21:50 +0800 |
commit | b6912edc8b09d2478065ff95c1b55561a41ff4c5 (patch) | |
tree | 41c38af8777fabedaa4ec5b648bf3107d6d71e95 | |
parent | f56ae9de2c19ee8d739b07909834816aa14ac6a1 (diff) | |
download | gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.tar gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.tar.gz gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.tar.bz2 gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.tar.lz gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.tar.xz gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.tar.zst gsoc2013-empathy-b6912edc8b09d2478065ff95c1b55561a41ff4c5.zip |
roster-view: factor out contact_should_be_displayed()
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index e68315cd1..4f89e4e6d 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -703,19 +703,21 @@ remove_from_displayed (EmpathyRosterView *self, update_empty (self, TRUE); } +/** + * check if @contact should be displayed according to @self's current status + * and without consideration for the state of @contact's groups. + */ static gboolean -filter_contact (EmpathyRosterView *self, +contact_should_be_displayed (EmpathyRosterView *self, EmpathyRosterContact *contact) { - gboolean displayed; - if (is_searching (self)) { FolksIndividual *individual; individual = empathy_roster_contact_get_individual (contact); - displayed = empathy_individual_match_string (individual, + return empathy_individual_match_string (individual, empathy_live_search_get_text (self->priv->search), empathy_live_search_get_words (self->priv->search)); } @@ -723,13 +725,22 @@ filter_contact (EmpathyRosterView *self, { if (self->priv->show_offline) { - displayed = TRUE; + return TRUE; } else { - displayed = empathy_roster_contact_is_online (contact); + return empathy_roster_contact_is_online (contact); } } +} + +static gboolean +filter_contact (EmpathyRosterView *self, + EmpathyRosterContact *contact) +{ + gboolean displayed; + + displayed = contact_should_be_displayed (self, contact); if (self->priv->show_groups) { |