changeset 27846:24e5f6357cb5

merge of 'bc3bb7129b398700639d32f7d6b85fc155053f82' and 'cd201a23c1b0c9571298b531f87dde3a7c373576'
author Paul Aurich <paul@darkrain42.org>
date Thu, 06 Aug 2009 05:50:42 +0000
parents 13304cc385d7 (current diff) 975fc5f64438 (diff)
children 6e619950eda3
files
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Thu Aug 06 05:49:47 2009 +0000
+++ b/libpurple/protocols/msn/contact.c	Thu Aug 06 05:50:42 2009 +0000
@@ -351,14 +351,24 @@
 msn_parse_each_member(MsnSession *session, xmlnode *member, const char *node,
 	MsnListId list)
 {
-	char *passport = xmlnode_get_data(xmlnode_get_child(member, node));
-	char *type = xmlnode_get_data(xmlnode_get_child(member, "Type"));
-	char *member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId"));
-	MsnUser *user = msn_userlist_find_add_user(session->userlist, passport, NULL);
+	char *passport;
+	char *type;
+	char *member_id;
+	MsnUser *user;
 	xmlnode *annotation;
 	guint nid = MSN_NETWORK_UNKNOWN;
 	char *invite = NULL;
 
+	passport = xmlnode_get_data(xmlnode_get_child(member, node));
+	if (!purple_email_is_valid(passport)) {
+		g_free(passport);
+		return;
+	}
+
+	type = xmlnode_get_data(xmlnode_get_child(member, "Type"));
+	member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId"));
+	user = msn_userlist_find_add_user(session->userlist, passport, NULL);
+
 	for (annotation = xmlnode_get_child(member, "Annotations/Annotation");
 	     annotation;
 	     annotation = xmlnode_get_next_twin(annotation)) {
@@ -746,6 +756,9 @@
 		if (passport == NULL)
 			continue;
 
+		if (!purple_email_is_valid(passport))
+			continue;
+
 		if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
 			Name = xmlnode_get_data(displayName);
 		else