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/empathy-utils.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/empathy-utils.c')
-rw-r--r-- | libempathy/empathy-utils.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 7ab59814f..da7dc3b9f 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -782,7 +782,7 @@ empathy_folks_individual_contains_contact (FolksIndividual *individual) personas = folks_individual_get_personas (individual); for (l = personas; l != NULL; l = l->next) { - if (TPF_IS_PERSONA (l->data)) + if (empathy_folks_persona_is_interesting (FOLKS_PERSONA (l->data))) return (tpf_persona_get_contact (TPF_PERSONA (l->data)) != NULL); } @@ -809,7 +809,7 @@ empathy_contact_dup_from_folks_individual (FolksIndividual *individual) { TpfPersona *persona = l->data; - if (TPF_IS_PERSONA (persona)) + if (empathy_folks_persona_is_interesting (FOLKS_PERSONA (persona))) { TpContact *tp_contact; @@ -909,6 +909,24 @@ empathy_connection_can_group_personas (TpConnection *connection) FOLKS_MAYBE_BOOL_TRUE); } +gboolean +empathy_folks_persona_is_interesting (FolksPersona *persona) +{ + /* We're not interested in non-Telepathy personas */ + if (!TPF_IS_PERSONA (persona)) + return FALSE; + + /* We're not interested in user personas which haven't been added to the + * contact list (see bgo#637151). */ + if (folks_persona_get_is_user (persona) && + !tpf_persona_get_is_in_contact_list (TPF_PERSONA (persona))) + { + return FALSE; + } + + return TRUE; +} + gchar * empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert) { |