[empathy] empathy_connection_can_*_personas: check if connection is connected



commit 8d3d11d5e3866cf4cfd730af4252c10fdd5783ed
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Aug 30 10:44:02 2011 +0200

    empathy_connection_can_*_personas: check if connection is connected
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657266

 libempathy/empathy-utils.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index f0ecc0d..ec41f9b 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -780,6 +780,10 @@ empathy_connection_can_add_personas (TpConnection *connection)
 
   g_return_val_if_fail (TP_IS_CONNECTION (connection), FALSE);
 
+  if (tp_connection_get_status (connection, NULL) !=
+          TP_CONNECTION_STATUS_CONNECTED)
+      return FALSE;
+
   persona_store = FOLKS_PERSONA_STORE (
       empathy_dup_persona_store_for_connection (connection));
 
@@ -799,6 +803,10 @@ empathy_connection_can_alias_personas (TpConnection *connection)
 
   g_return_val_if_fail (TP_IS_CONNECTION (connection), FALSE);
 
+  if (tp_connection_get_status (connection, NULL) !=
+          TP_CONNECTION_STATUS_CONNECTED)
+      return FALSE;
+
   persona_store = FOLKS_PERSONA_STORE (
       empathy_dup_persona_store_for_connection (connection));
 
@@ -818,6 +826,10 @@ empathy_connection_can_group_personas (TpConnection *connection)
 
   g_return_val_if_fail (TP_IS_CONNECTION (connection), FALSE);
 
+  if (tp_connection_get_status (connection, NULL) !=
+          TP_CONNECTION_STATUS_CONNECTED)
+      return FALSE;
+
   persona_store = FOLKS_PERSONA_STORE (
       empathy_dup_persona_store_for_connection (connection));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]