summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2013-04-12 11:16:42 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2013-04-12 11:20:35 +0100
commit4541819cc4133d1dfe6d3766c6cf8f0204a4c65f (patch)
treea1dcb55b85600ca169c7153c9cedc225e9f907d9
parent71f9f850be1eefc949c400a3081a7edaa336aec2 (diff)
downloadtelepathy-haze-4541819cc4133d1dfe6d3766c6cf8f0204a4c65f.tar.gz
Don't call purple_account_disconnect() if pw request fails
prpl-jabber, prpl-silc, prpl-sipe all deal with taking the account offline one way or another in their cancel_cb, and calling purple_account_disconnect() without checking purple_account_is_disconnected() causes a critical warning if the account is already offline.
-rw-r--r--src/connection.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/connection.c b/src/connection.c
index 424802e..5518214 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -453,22 +453,19 @@ _haze_connection_password_manager_prompt_cb (GObject *source,
if (priv->password_request)
{
haze_request_password_cb (priv->password_request, NULL);
+ /* no need to call purple_account_disconnect(): the prpl will take
+ * the account offline. If we're lucky it'll use an
+ * AUTHENTICATION_FAILED-type message.
+ */
}
-
- if (base_conn->status != TP_CONNECTION_STATUS_DISCONNECTED)
+ else if (base_conn->status != TP_CONNECTION_STATUS_DISCONNECTED)
{
tp_base_connection_disconnect_with_dbus_error (base_conn,
tp_error_get_dbus_name (error->code), NULL,
TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED);
- }
-
- /* no need to call purple_account_disconnect because _connect
- * was never called ...
- * ... unless we had a dynamic password request */
- if (priv->password_request)
- {
- priv->disconnecting = TRUE;
- purple_account_disconnect (self->account);
+ /* no need to call purple_account_disconnect because _connect
+ * was never called ...
+ */
}
g_error_free (error);