changeset 26501:0b616d9aa6bb

propagate from branch 'im.pidgin.pidgin' (head e028e1fa5d4d70792f0219311b12e5f4b1587776) to branch 'im.pidgin.pidgin.vv' (head a423c1d70ce3825dacb1a625bb4f5c713936e268)
author Mike Ruprecht <maiku@soc.pidgin.im>
date Fri, 03 Apr 2009 07:10:07 +0000
parents da651b0f40a1 (current diff) d58ea4aa159d (diff)
children 5f80ccce8003
files
diffstat 1 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Fri Apr 03 06:59:41 2009 +0000
+++ b/libpurple/protocols/msn/contact.c	Fri Apr 03 07:10:07 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 */