aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-view.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2011-01-30 00:16:29 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2011-02-18 08:04:45 +0800
commit7365b5426c1e281f49bd67506c09ce76ffb67e2c (patch)
treefc7ab108424e93aad9463308ed79b3caf5482427 /libempathy-gtk/empathy-individual-view.c
parent6103b13b462a07a8b508ee2223ef1e5acfc8dd47 (diff)
downloadgsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.tar
gsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.tar.gz
gsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.tar.bz2
gsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.tar.lz
gsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.tar.xz
gsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.tar.zst
gsoc2013-empathy-7365b5426c1e281f49bd67506c09ce76ffb67e2c.zip
Bug 637151 — Hide the user Individual from the contact list
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
Diffstat (limited to 'libempathy-gtk/empathy-individual-view.c')
-rw-r--r--libempathy-gtk/empathy-individual-view.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index eb2bb4003..29bf2e645 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -1614,7 +1614,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. */
@@ -1624,6 +1624,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)
@@ -1636,14 +1650,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);