Commit a4cd05f5 authored by Travis Reitter's avatar Travis Reitter

Use Folks to check if a TpConnection can alias and group personas.

Helps bgo#625969.
parent 4f39984a
......@@ -822,15 +822,12 @@ empathy_individual_edit_menu_item_new (FolksIndividual *individual)
if (empathy_individual_manager_initialized ())
{
TpConnection *connection;
EmpathyIndividualManagerFlags flags;
manager = empathy_individual_manager_dup_singleton ();
connection = empathy_contact_get_connection (contact);
flags = empathy_individual_manager_get_flags_for_connection (
manager, connection);
enable = (flags & EMPATHY_INDIVIDUAL_MANAGER_CAN_ALIAS ||
flags & EMPATHY_INDIVIDUAL_MANAGER_CAN_GROUP);
enable = (empathy_connection_can_alias_personas (connection) &&
empathy_connection_can_group_personas (connection));
g_object_unref (manager);
}
......
......@@ -822,6 +822,34 @@ empathy_connection_can_add_personas (TpConnection *connection)
FOLKS_MAYBE_BOOL_TRUE);
}
gboolean
empathy_connection_can_alias_personas (TpConnection *connection)
{
FolksPersonaStore *persona_store;
g_return_val_if_fail (TP_IS_CONNECTION (connection), FALSE);
persona_store = FOLKS_PERSONA_STORE (
empathy_get_persona_store_for_connection (connection));
return (folks_persona_store_get_can_alias_personas (persona_store) ==
FOLKS_MAYBE_BOOL_TRUE);
}
gboolean
empathy_connection_can_group_personas (TpConnection *connection)
{
FolksPersonaStore *persona_store;
g_return_val_if_fail (TP_IS_CONNECTION (connection), FALSE);
persona_store = FOLKS_PERSONA_STORE (
empathy_get_persona_store_for_connection (connection));
return (folks_persona_store_get_can_group_personas (persona_store) ==
FOLKS_MAYBE_BOOL_TRUE);
}
gchar *
empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert)
{
......
......@@ -102,6 +102,8 @@ EmpathyContact * empathy_contact_dup_from_folks_individual (FolksIndividual *ind
TpChannelGroupChangeReason tp_channel_group_change_reason_from_folks_groups_change_reason (FolksGroupableChangeReason reason);
TpfPersonaStore * empathy_get_persona_store_for_connection (TpConnection *connection);
gboolean empathy_connection_can_add_personas (TpConnection *connection);
gboolean empathy_connection_can_alias_personas (TpConnection *connection);
gboolean empathy_connection_can_group_personas (TpConnection *connection);
gchar * empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment