]> git.0d.be Git - empathy.git/commitdiff
empathy_connection_can_*_personas: check if connection is connected
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 30 Aug 2011 08:44:02 +0000 (10:44 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 2 Sep 2011 13:21:16 +0000 (15:21 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=657266

libempathy/empathy-utils.c

index f0ecc0ddfc94895eb8466005de1c495dd944d74d..ec41f9b388f8ce182d7c221dc96d168a98f7697a 100644 (file)
@@ -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));