comparison libpurple/protocols/msn/contact.c @ 22571:8041c74e36d7

patch from Maiku to ignore non-messenger contacts, fixes #3305
author Ka-Hing Cheung <khc@hxbc.us>
date Sat, 29 Mar 2008 16:03:16 +0000
parents 207f51e16b50
children 7d3b2c023ad8
comparison
equal deleted inserted replaced
22570:1168dc635ac1 22571:8041c74e36d7
523 char *passport = NULL, *Name = NULL, *uid = NULL, *type = NULL, *mobile_number = NULL; 523 char *passport = NULL, *Name = NULL, *uid = NULL, *type = NULL, *mobile_number = NULL;
524 gboolean mobile = FALSE; 524 gboolean mobile = FALSE;
525 525
526 for(contactNode = xmlnode_get_child(node, "Contact"); contactNode; 526 for(contactNode = xmlnode_get_child(node, "Contact"); contactNode;
527 contactNode = xmlnode_get_next_twin(contactNode)) { 527 contactNode = xmlnode_get_next_twin(contactNode)) {
528 xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds; 528 xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds, *messenger_user;
529 MsnUser *user; 529 MsnUser *user;
530 MsnUserType usertype; 530 MsnUserType usertype;
531 531
532 if (!(contactId = xmlnode_get_child(contactNode,"contactId")) 532 if (!(contactId = xmlnode_get_child(contactNode,"contactId"))
533 || !(contactInfo = xmlnode_get_child(contactNode, "contactInfo")) 533 || !(contactInfo = xmlnode_get_child(contactNode, "contactInfo"))
550 if ((displayName = xmlnode_get_child(contactInfo, "displayName"))) 550 if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
551 friendly = xmlnode_get_data(displayName); 551 friendly = xmlnode_get_data(displayName);
552 purple_connection_set_display_name(session->account->gc, friendly ? purple_url_decode(friendly) : NULL); 552 purple_connection_set_display_name(session->account->gc, friendly ? purple_url_decode(friendly) : NULL);
553 g_free(friendly); 553 g_free(friendly);
554 continue; /* Not adding own account as buddy to buddylist */ 554 continue; /* Not adding own account as buddy to buddylist */
555 }
556
557 /* ignore non-messenger contacts */
558 if((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) {
559 char *is_messenger_user = xmlnode_get_data(messenger_user);
560
561 if(is_messenger_user && !strcmp(is_messenger_user, "false")) {
562 g_free(is_messenger_user);
563 continue;
564 }
565
566 g_free(is_messenger_user);
555 } 567 }
556 568
557 usertype = msn_get_user_type(type); 569 usertype = msn_get_user_type(type);
558 passportName = xmlnode_get_child(contactInfo, "passportName"); 570 passportName = xmlnode_get_child(contactInfo, "passportName");
559 if (passportName == NULL) { 571 if (passportName == NULL) {