comparison libpurple/protocols/msn/contact.c @ 28187:975fc5f64438

Ignore buddies with invalid emails in the membership list or address book, which, to be honest, were probably caused by older versions of Pidgin that were not checking and sending the invalid buddies anyway. Fixes #9505.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 06 Aug 2009 05:25:23 +0000
parents 3698c7f4d803
children 867b4cdc01bf
comparison
equal deleted inserted replaced
28184:f9cf1e14838b 28187:975fc5f64438
349 349
350 static void 350 static void
351 msn_parse_each_member(MsnSession *session, xmlnode *member, const char *node, 351 msn_parse_each_member(MsnSession *session, xmlnode *member, const char *node,
352 MsnListId list) 352 MsnListId list)
353 { 353 {
354 char *passport = xmlnode_get_data(xmlnode_get_child(member, node)); 354 char *passport;
355 char *type = xmlnode_get_data(xmlnode_get_child(member, "Type")); 355 char *type;
356 char *member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId")); 356 char *member_id;
357 MsnUser *user = msn_userlist_find_add_user(session->userlist, passport, NULL); 357 MsnUser *user;
358 xmlnode *annotation; 358 xmlnode *annotation;
359 guint nid = MSN_NETWORK_UNKNOWN; 359 guint nid = MSN_NETWORK_UNKNOWN;
360 char *invite = NULL; 360 char *invite = NULL;
361
362 passport = xmlnode_get_data(xmlnode_get_child(member, node));
363 if (!purple_email_is_valid(passport)) {
364 g_free(passport);
365 return;
366 }
367
368 type = xmlnode_get_data(xmlnode_get_child(member, "Type"));
369 member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId"));
370 user = msn_userlist_find_add_user(session->userlist, passport, NULL);
361 371
362 for (annotation = xmlnode_get_child(member, "Annotations/Annotation"); 372 for (annotation = xmlnode_get_child(member, "Annotations/Annotation");
363 annotation; 373 annotation;
364 annotation = xmlnode_get_next_twin(annotation)) { 374 annotation = xmlnode_get_next_twin(annotation)) {
365 char *name = xmlnode_get_data(xmlnode_get_child(annotation, "Name")); 375 char *name = xmlnode_get_data(xmlnode_get_child(annotation, "Name"));
742 passport = xmlnode_get_data(passportName); 752 passport = xmlnode_get_data(passportName);
743 } 753 }
744 754
745 /* Couldn't find anything */ 755 /* Couldn't find anything */
746 if (passport == NULL) 756 if (passport == NULL)
757 continue;
758
759 if (!purple_email_is_valid(passport))
747 continue; 760 continue;
748 761
749 if ((displayName = xmlnode_get_child(contactInfo, "displayName"))) 762 if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
750 Name = xmlnode_get_data(displayName); 763 Name = xmlnode_get_data(displayName);
751 else 764 else