telepathy-haze: Don't call purple_account_disconnect() if pw request fails

Will Thompson wjt at kemper.freedesktop.org
Fri Apr 12 03:21:34 PDT 2013


Module: telepathy-haze
Branch: master
Commit: 4541819cc4133d1dfe6d3766c6cf8f0204a4c65f
URL:    http://cgit.freedesktop.org/telepathy/telepathy-haze/commit/?id=4541819cc4133d1dfe6d3766c6cf8f0204a4c65f

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Fri Apr 12 11:16:42 2013 +0100

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.

---

 src/connection.c |   19 ++++++++-----------
 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);



More information about the telepathy-commits mailing list