From 753a1862257d4c14fb2475a73ec08aeabdb7d907 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 29 Jan 2011 16:16:29 +0000 Subject: =?UTF-8?q?Bug=20637151=20=E2=80=94=20Hide=20the=20user=20Individu?= =?UTF-8?q?al=20from=20the=20contact=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generalise the mechanism used to determine whether a persona is to be displayed by Empathy to also take into account whether the persona is the user and, if so, whether they're in the contact list. This bumps the libfolks dependency to 0.3.5. Closes: bgo#637151 --- libempathy-gtk/empathy-individual-view.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'libempathy-gtk/empathy-individual-view.c') diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index fe236b3fd..9be022139 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1681,7 +1681,7 @@ individual_view_is_visible_individual (EmpathyIndividualView *self, EmpathyLiveSearch *live = EMPATHY_LIVE_SEARCH (priv->search_widget); const gchar *str; GList *personas, *l; - gboolean is_favorite; + gboolean is_favorite, contains_interesting_persona = FALSE; /* We're only giving the visibility wrt filtering here, not things like * presence. */ @@ -1691,6 +1691,20 @@ individual_view_is_visible_individual (EmpathyIndividualView *self, return FALSE; } + /* Hide all individuals which consist entirely of uninteresting personas */ + personas = folks_individual_get_personas (individual); + for (l = personas; l; l = l->next) + { + if (empathy_folks_persona_is_interesting (FOLKS_PERSONA (l->data))) + { + contains_interesting_persona = TRUE; + break; + } + } + + if (contains_interesting_persona == FALSE) + return FALSE; + is_favorite = folks_favouritable_get_is_favourite ( FOLKS_FAVOURITABLE (individual)); if (is_searching == FALSE) @@ -1703,14 +1717,13 @@ individual_view_is_visible_individual (EmpathyIndividualView *self, return TRUE; /* check contact id, remove the @server.com part */ - personas = folks_individual_get_personas (individual); for (l = personas; l; l = l->next) { const gchar *p; gchar *dup_str = NULL; gboolean visible; - if (!TPF_IS_PERSONA (l->data)) + if (!empathy_folks_persona_is_interesting (FOLKS_PERSONA (l->data))) continue; str = folks_persona_get_display_id (l->data); @@ -2388,7 +2401,7 @@ individual_view_remove_activate_cb (GtkMenuItem *menuitem, * be removed. */ for (l = personas; l != NULL; l = l->next) { - if (!TPF_IS_PERSONA (l->data)) + if (!empathy_folks_persona_is_interesting (FOLKS_PERSONA (l->data))) continue; persona_count++; -- cgit v1.2.3