pidgin: f0df27a2: Save a count of how many ADL (per-reques...

qulogic at pidgin.im qulogic at pidgin.im
Sat Mar 28 04:05:48 EDT 2009


-----------------------------------------------------------------
Revision: f0df27a299120baecf9ea88a9fb24ffe1dbe72fd
Ancestor: 70fa4cc384b7643ab1f296bdc2399bc208542a20
Author: qulogic at pidgin.im
Date: 2009-03-28T07:31:29
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f0df27a299120baecf9ea88a9fb24ffe1dbe72fd

Modified files:
        libpurple/protocols/msn/notification.c
        libpurple/protocols/msn/session.h

ChangeLog: 

Save a count of how many ADL (per-request) and FQY (per-contact) we send,
and then finish login only after they've all completed.

Fixes #8588.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	a87fe21fa1e66ce8e5dfe09bd9bb62bff8a8b62b
+++ libpurple/protocols/msn/notification.c	90219dc821aecd41418629a63a19ba6c45e6cbdc
@@ -630,7 +630,7 @@ update_contact_network(MsnSession *sessi
 
 	} else {
 		purple_debug_error("msn",
-		                   "Got FQY update for unkwown user %s on network %d.\n",
+		                   "Got FQY update for unknown user %s on network %d.\n",
 		                   passport, network);
 	}
 }
@@ -686,6 +686,9 @@ msn_notification_dump_contact(MsnSession
 			if (++adl_count % 150 == 0) {
 				payload = xmlnode_to_str(adl_node, &payload_len);
 
+				/* ADL's are returned all-together */
+				session->adl_fqy++;
+
 				msn_notification_post_adl(session->notification->cmdproc,
 					payload, payload_len);
 
@@ -697,6 +700,9 @@ msn_notification_dump_contact(MsnSession
 				xmlnode_set_attrib(adl_node, "l", "1");
 			}
 		} else {
+			/* FQY's are returned one-at-a-time */
+			session->adl_fqy++;
+
 			msn_add_contact_xml(session, fqy_node, user->passport,
 				0, user->networkid);
 
@@ -718,6 +724,9 @@ msn_notification_dump_contact(MsnSession
 	if (adl_count == 0 || adl_count % 150 != 0) {
 		payload = xmlnode_to_str(adl_node, &payload_len);
 
+		/* ADL's are returned all-together */
+		session->adl_fqy++;
+
 		msn_notification_post_adl(session->notification->cmdproc, payload, payload_len);
 
 		g_free(payload);
@@ -804,7 +813,8 @@ adl_cmd(MsnCmdProc *cmdproc, MsnCommand 
 
 	if (!strcmp(cmd->params[1], "OK")) {
 		/* ADL ack */
-		msn_session_finish_login(session);
+		if (--session->adl_fqy == 0)
+			msn_session_finish_login(session);
 	} else {
 		cmdproc->last_cmd->payload_cb = adl_cmd_parse;
 		cmd->payload_len = atoi(cmd->params[1]);
============================================================
--- libpurple/protocols/msn/session.h	984247a50594b306aafcc6e8aad380837c1b02a0
+++ libpurple/protocols/msn/session.h	c9a9484c07f665b77bde64e14eff18bad120e77f
@@ -90,6 +90,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. */
 	gboolean destroying; /**< A flag that states if the session is being destroyed. */
 	gboolean http_method;
 


More information about the Commits mailing list