[telepathy-glib/master] [TpAccount] Always return the TpConnection with _get_connection()

Danielle Madeley danielle at madeley.id.au
Wed Sep 23 06:34:19 PDT 2009


Even when it's not ready, otherwise there is no way for the caller to find
out when the TpConnection is ready.

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
 telepathy-glib/account.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index c986da7..f4c50d0 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -1394,8 +1394,10 @@ unescape_protocol (gchar *protocol)
  * tp_account_get_connection:
  * @account: a #TpAccount
  *
- * Get the connection of the account, or NULL if account is offline or the
- * connection is not yet ready. This function does not return a new ref.
+ * Get the connection of the account, or NULL if account is offline.
+ * This function does not return a new ref and it is not guaranteed that the
+ * returned #TpConnection object is ready
+ *
  *
  * Returns: the connection of the account.
  *
@@ -1406,11 +1408,7 @@ tp_account_get_connection (TpAccount *account)
 {
   TpAccountPrivate *priv = account->priv;
 
-  if (priv->connection != NULL &&
-      tp_connection_is_ready (priv->connection))
-    return priv->connection;
-
-  return NULL;
+  return priv->connection;
 }
 
 /**
-- 
1.5.6.5




More information about the telepathy-commits mailing list