changeset 26265:f2f4fbbb9006

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.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 01 Apr 2009 05:25:36 +0000
parents 5e5494482f01
children d58ea4aa159d
files libpurple/protocols/msn/contact.c
diffstat 1 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Mon Mar 30 05:52:32 2009 +0000
+++ b/libpurple/protocols/msn/contact.c	Wed Apr 01 05:25:36 2009 +0000
@@ -697,25 +697,28 @@
 				/*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)");
+						g_free(msnEnabled);
+						break;
+					}
 
-					/*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);
 			}
+			if (passport == NULL) /* Couldn't find anything */
+				continue;
 		} else {
 			xmlnode *messenger_user;
 			/* ignore non-messenger contacts */