adium.1-4: 998766ce: *** Plucked rev 6fd13fcd41c95794bed28699...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sun Aug 15 23:10:42 EDT 2010


----------------------------------------------------------------------
Revision: 998766ceb74c46b4d1e791c5152c38daa51f49f7
Parent:   dd496d006f7414efd30774f23f17af433cd38a0e
Author:   rekkanoryo at pidgin.im
Date:     08/15/10 23:07:08
Branch:   im.pidgin.adium.1-4
URL: http://d.pidgin.im/viewmtn/revision/info/998766ceb74c46b4d1e791c5152c38daa51f49f7

Changelog: 

*** Plucked rev 6fd13fcd41c95794bed286994ba8dc779da0aa01 (qulogic at pidgin.im):
Add a timeout which forces the login process to complete. This won't
fix the underlying problem of a failed FQY, but at least it will
complete the connection and show people online.

Refs #10023.
Refs #12210.

*** Plucked rev bf254d85fb121a0a699992e1f391b65d0e37b05d (qulogic at pidgin.im):
Clear the password on an MSN account if saving is disabled and the
password was wrong. This should be in line with what other prpls do.

Fixes #12290.


Plucks requested by Dimmuxx and rob-to86.

Changes against parent dd496d006f7414efd30774f23f17af433cd38a0e

  patched  libpurple/protocols/msn/notification.c
  patched  libpurple/protocols/msn/session.c
  patched  libpurple/protocols/msn/session.h

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	69b7b61551f3981cd4e030f126040341d4dd84d1
+++ libpurple/protocols/msn/notification.c	5e4ca29096d3b0d693d56c385ac4d61acaa05e0e
@@ -748,6 +748,8 @@ msn_notification_dump_contact(MsnSession
 	xmlnode_free(adl_node);
 	xmlnode_free(fqy_node);
 
+	msn_session_activate_login_timeout(session);
+
 	display_name = purple_connection_get_display_name(session->account->gc);
 	if (display_name
 	    && strcmp(display_name,
============================================================
--- libpurple/protocols/msn/session.c	9c45d6773028eb5ac5adb35e17b2ed10dd9f92c6
+++ libpurple/protocols/msn/session.c	7b73767ccc25b86493dc791924611a7e65c2b7d5
@@ -131,6 +131,11 @@ msn_session_disconnect(MsnSession *sessi
 	if (!session->connected)
 		return;
 
+	if (session->login_timeout) {
+		purple_timeout_remove(session->login_timeout);
+		session->login_timeout = 0;
+	}
+
 	session->connected = FALSE;
 
 	while (session->switches != NULL)
@@ -258,6 +263,28 @@ msn_session_get_swboard(MsnSession *sess
 	return swboard;
 }
 
+static gboolean
+msn_login_timeout_cb(gpointer data)
+{
+	MsnSession *session = data;
+	/* This forces the login process to finish, even though we haven't heard
+	   a response for our FQY requests yet. We'll at least end up online to the
+	   people we've already added. The rest will follow later. */
+	msn_session_finish_login(session);
+	session->login_timeout = 0;
+	return FALSE;
+}
+
+void
+msn_session_activate_login_timeout(MsnSession *session)
+{
+	if (!session->logged_in) {
+		session->login_timeout =
+			purple_timeout_add_seconds(MSN_LOGIN_FQY_TIMEOUT,
+			                           msn_login_timeout_cb, session);
+	}
+}
+
 static void
 msn_session_sync_users(MsnSession *session)
 {
@@ -362,6 +389,9 @@ msn_session_set_error(MsnSession *sessio
 			msg = g_strdup_printf(_("Unable to authenticate: %s"),
 								  (info == NULL ) ?
 								  _("Unknown error") : info);
+			/* Clear the password if it isn't being saved */
+			if (!purple_account_get_remember_password(session->account))
+				purple_account_set_password(session->account, NULL);
 			break;
 		case MSN_ERROR_BAD_BLIST:
 			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
============================================================
--- libpurple/protocols/msn/session.h	1bb2cb4677ad0100d5a95dcc33c06a501e9255c0
+++ libpurple/protocols/msn/session.h	ab1581b4479bd685479a2ad74a281cf8427a45c9
@@ -59,6 +59,8 @@ typedef enum
 
 #define MSN_LOGIN_STEPS MSN_LOGIN_STEP_END
 
+#define MSN_LOGIN_FQY_TIMEOUT 30
+
 #include "group.h"
 #include "httpconn.h"
 #include "nexus.h"
@@ -83,6 +85,7 @@ struct _MsnSession
 	gboolean connected;
 	gboolean logged_in; /**< A temporal flag to ignore local buddy list adds. */
 	int      adl_fqy; /**< A count of ADL/FQY so status is only changed once. */
+	guint    login_timeout; /**< Timeout to force status change if ADL/FQY fail. */
 	gboolean destroying; /**< A flag that states if the session is being destroyed. */
 	gboolean http_method;
 
@@ -213,9 +216,18 @@ void msn_session_set_error(MsnSession *s
 						   const char *info);
 
 /**
- * Sets the current step in the login proccess.
+ * Starts a timeout to initiate finishing login. Sometimes the server ignores
+ * our FQY requests, so this forces ourselves online eventually.
  *
  * @param session The MSN session.
+ */
+void
+msn_session_activate_login_timeout(MsnSession *session);
+
+/**
+ * Sets the current step in the login process.
+ *
+ * @param session The MSN session.
  * @param step The current step.
  */
 void msn_session_set_login_step(MsnSession *session, MsnLoginStep step);


More information about the Commits mailing list