From 5008b9578d0d815b87ae6145f122a8cf37671524 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Thu, 18 Aug 2011 18:35:00 +0100 Subject: Don't throw a hissy-fit if the account is CONNECTING but the connection is not --- src/mcd-connection.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mcd-connection.c b/src/mcd-connection.c index 3aaf37cc..12fde5b6 100644 --- a/src/mcd-connection.c +++ b/src/mcd-connection.c @@ -2681,6 +2681,7 @@ void _mcd_connection_connect (McdConnection *connection, GHashTable *params) { McdConnectionPrivate *priv; + TpConnectionStatus status = TP_CONNECTION_STATUS_DISCONNECTED; g_return_if_fail (MCD_IS_CONNECTION (connection)); g_return_if_fail (params != NULL); @@ -2697,8 +2698,15 @@ _mcd_connection_connect (McdConnection *connection, GHashTable *params) priv->reconnect_timer = 0; } - if (mcd_account_get_connection_status (priv->account) == - TP_CONNECTION_STATUS_DISCONNECTED) + /* the account's status can be CONNECTING _before_ we get here, because + * for the account that includes things like trying to bring up an IAP + * via an McdTransport plugin. So we have to use the actual status of + * the connection (or DISCONNECTED if we havan't got one yet) */ + if (priv->tp_conn != NULL) + status = tp_connection_get_status (priv->tp_conn, NULL); + + if (status == TP_CONNECTION_STATUS_DISCONNECTED || + status == TP_UNKNOWN_CONNECTION_STATUS) { _mcd_connection_connect_with_params (connection, params); } -- cgit v1.2.1