Mercurial > pidgin
diff libpurple/protocols/msn/contact.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | 01ff09d4a463 90ae6701eaf2 |
children |
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c Sat Jun 02 02:30:13 2012 +0000 +++ b/libpurple/protocols/msn/contact.c Sat Jun 02 02:30:49 2012 +0000 @@ -740,6 +740,20 @@ } passportName = xmlnode_get_child(contactInfo, "passportName"); + if (passportName != NULL) { + xmlnode *messenger_user; + /* ignore non-messenger contacts */ + if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) { + char *is_messenger_user = xmlnode_get_data(messenger_user); + + if (is_messenger_user && !strcmp(is_messenger_user, "false")) { + passportName = NULL; + } + + g_free(is_messenger_user); + } + } + if (passportName == NULL) { xmlnode *emailsNode, *contactEmailNode, *emailNode; xmlnode *messengerEnabledNode; @@ -773,19 +787,6 @@ } } } else { - xmlnode *messenger_user; - /* ignore non-messenger contacts */ - if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) { - char *is_messenger_user = xmlnode_get_data(messenger_user); - - if (is_messenger_user && !strcmp(is_messenger_user, "false")) { - g_free(is_messenger_user); - continue; - } - - g_free(is_messenger_user); - } - passport = xmlnode_get_data(passportName); } @@ -992,7 +993,7 @@ purple_debug_misc("msn", "Got the Address Book!\n"); if (msn_parse_addressbook(session, resp->xml)) { - msn_send_privacy(session->account->gc); + msn_send_privacy(purple_account_get_connection(session->account)); msn_notification_dump_contact(session); } else { /* This is making us loop infinitely when we fail to parse the @@ -1275,7 +1276,7 @@ body = g_markup_escape_text(user->invite_message, -1); /* Ignore the cast, we treat it as const anyway. */ - tmp = (char *)purple_connection_get_display_name(session->account->gc); + tmp = (char *)purple_connection_get_display_name(purple_account_get_connection(session->account)); tmp = tmp ? g_markup_escape_text(tmp, -1) : g_strdup(""); invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp);