summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2011-08-18 18:35:00 +0100
committerVivek Dasmohapatra <vivek@collabora.co.uk>2011-09-06 16:18:43 +0100
commit5008b9578d0d815b87ae6145f122a8cf37671524 (patch)
tree3f2758a2f4b37a7e41a4ba7e36b4a42f1a5238b4
parent91036eb72b06fe28a0a95b7b575cc0593ce76dd0 (diff)
downloadtelepathy-mission-control-5008b9578d0d815b87ae6145f122a8cf37671524.tar.gz
Don't throw a hissy-fit if the account is CONNECTING but the connection is not
-rw-r--r--src/mcd-connection.c12
1 files 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);
}