diff options
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-contact.c | 4 | ||||
-rw-r--r-- | libempathy/empathy-utils.c | 22 | ||||
-rw-r--r-- | libempathy/empathy-utils.h | 1 |
3 files changed, 23 insertions, 4 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 9ae26142a..0547ef82d 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -885,7 +885,7 @@ empathy_contact_get_persona (EmpathyContact *contact) { TpfPersona *persona = j->data; - if (TPF_IS_PERSONA (persona)) + if (empathy_folks_persona_is_interesting (FOLKS_PERSONA (persona))) { TpContact *tp_contact = tpf_persona_get_contact (persona); @@ -1958,7 +1958,7 @@ empathy_contact_dup_best_for_action (FolksIndividual *individual, TpContact *tp_contact; EmpathyContact *contact; - if (!TPF_IS_PERSONA (l->data)) + if (!empathy_folks_persona_is_interesting (FOLKS_PERSONA (l->data))) continue; tp_contact = tpf_persona_get_contact (TPF_PERSONA (l->data)); 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) { diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 0f5f968a5..6e16f0a77 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -113,6 +113,7 @@ TpfPersonaStore * empathy_get_persona_store_for_connection (TpConnection *connec gboolean empathy_connection_can_add_personas (TpConnection *connection); gboolean empathy_connection_can_alias_personas (TpConnection *connection); gboolean empathy_connection_can_group_personas (TpConnection *connection); +gboolean empathy_folks_persona_is_interesting (FolksPersona *persona); gchar * empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert); |