pidgin: bf71505b: Fix a faulty condition that would result...

qulogic at pidgin.im qulogic at pidgin.im
Wed Apr 1 01:30:37 EDT 2009


-----------------------------------------------------------------
Revision: bf71505ba5c16f1c3091dac6ba4950894f6d6960
Ancestor: 0064869870b3507952491598f4d4b8d4a99fbc6b
Author: qulogic at pidgin.im
Date: 2009-04-01T05:25:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/bf71505ba5c16f1c3091dac6ba4950894f6d6960

Modified files:
        libpurple/protocols/msn/contact.c

ChangeLog: 

Fix a faulty condition that would result in an attempt to add most of your
email-only contacts to your buddy and/or privacy list. This was temporary,
but resulted in a lot of extra traffic during login.

References #8579.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c	5e45827fb84755ed6501af8166b5ca9271bf3102
+++ libpurple/protocols/msn/contact.c	c3a440dbb8cbef444ea2b6e5986e259620ea63b6
@@ -697,25 +697,28 @@ msn_parse_addressbook_contacts(MsnSessio
 				/*TODO:  need to support the Mobile type*/
 				continue;
 			}
-			for (contactEmailNode = xmlnode_get_child(emailsNode, "ContactEmail"); contactEmailNode;
-					contactEmailNode = xmlnode_get_next_twin(contactEmailNode)) {
-				if (!(messengerEnabledNode = xmlnode_get_child(contactEmailNode, "isMessengerEnabled")))
-					continue;
+			for (contactEmailNode = xmlnode_get_child(emailsNode, "ContactEmail");
+			     contactEmailNode;
+			     contactEmailNode = xmlnode_get_next_twin(contactEmailNode)) {
+				if ((messengerEnabledNode = xmlnode_get_child(contactEmailNode, "isMessengerEnabled"))) {
 
-				msnEnabled = xmlnode_get_data(messengerEnabledNode);
+					msnEnabled = xmlnode_get_data(messengerEnabledNode);
 
-				if (msnEnabled && !strcmp(msnEnabled, "true")) {
-					if ((emailNode = xmlnode_get_child(contactEmailNode, "email")))
-						passport = xmlnode_get_data(emailNode);
+					if (msnEnabled && !strcmp(msnEnabled, "true")) {
+						if ((emailNode = xmlnode_get_child(contactEmailNode, "email")))
+							passport = xmlnode_get_data(emailNode);
 
-					/*Messenger enabled, Get the Passport*/
-					purple_debug_info("msn", "AB Yahoo/Federated User %s\n", passport ? passport : "(null)");
+						/* Messenger enabled, Get the Passport*/
+						purple_debug_info("msn", "AB Yahoo/Federated User %s\n", passport ? passport : "(null)");
+						g_free(msnEnabled);
+						break;
+					}
+
 					g_free(msnEnabled);
-					break;
 				}
-
-				g_free(msnEnabled);
 			}
+			if (passport == NULL) /* Couldn't find anything */
+				continue;
 		} else {
 			xmlnode *messenger_user;
 			/* ignore non-messenger contacts */


More information about the Commits mailing list