diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2011-01-30 00:16:29 +0800 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2011-02-18 07:47:31 +0800 |
commit | 753a1862257d4c14fb2475a73ec08aeabdb7d907 (patch) | |
tree | bcf78312b1b7954818b929dfac44786e59b247a2 /libempathy-gtk/empathy-individual-view.c | |
parent | d008f215bc41f4e69ff01879047ec946a4370148 (diff) | |
download | gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.tar gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.tar.gz gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.tar.bz2 gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.tar.lz gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.tar.xz gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.tar.zst gsoc2013-empathy-753a1862257d4c14fb2475a73ec08aeabdb7d907.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.c | 21 |
1 files changed, 17 insertions, 4 deletions
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++; |