diff options
-rw-r--r-- | libempathy-gtk/empathy-individual-menu.c | 7 | ||||
-rw-r--r-- | libempathy/empathy-utils.c | 28 | ||||
-rw-r--r-- | libempathy/empathy-utils.h | 2 |
3 files changed, 32 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c index b1237cf8b..e3159b401 100644 --- a/libempathy-gtk/empathy-individual-menu.c +++ b/libempathy-gtk/empathy-individual-menu.c @@ -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); } diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index e6dc34303..6bbd53f86 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -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) { diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 7b9f897fb..3c89962c1 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -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); |