Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
32818:01ff09d4a463 | 32819:2c6510167895 |
---|---|
738 | 738 |
739 continue; /* Not adding own account as buddy to buddylist */ | 739 continue; /* Not adding own account as buddy to buddylist */ |
740 } | 740 } |
741 | 741 |
742 passportName = xmlnode_get_child(contactInfo, "passportName"); | 742 passportName = xmlnode_get_child(contactInfo, "passportName"); |
743 if (passportName != NULL) { | |
744 xmlnode *messenger_user; | |
745 /* ignore non-messenger contacts */ | |
746 if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) { | |
747 char *is_messenger_user = xmlnode_get_data(messenger_user); | |
748 | |
749 if (is_messenger_user && !strcmp(is_messenger_user, "false")) { | |
750 passportName = NULL; | |
751 } | |
752 | |
753 g_free(is_messenger_user); | |
754 } | |
755 } | |
756 | |
743 if (passportName == NULL) { | 757 if (passportName == NULL) { |
744 xmlnode *emailsNode, *contactEmailNode, *emailNode; | 758 xmlnode *emailsNode, *contactEmailNode, *emailNode; |
745 xmlnode *messengerEnabledNode; | 759 xmlnode *messengerEnabledNode; |
746 char *msnEnabled; | 760 char *msnEnabled; |
747 | 761 |
771 | 785 |
772 g_free(msnEnabled); | 786 g_free(msnEnabled); |
773 } | 787 } |
774 } | 788 } |
775 } else { | 789 } else { |
776 xmlnode *messenger_user; | |
777 /* ignore non-messenger contacts */ | |
778 if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) { | |
779 char *is_messenger_user = xmlnode_get_data(messenger_user); | |
780 | |
781 if (is_messenger_user && !strcmp(is_messenger_user, "false")) { | |
782 g_free(is_messenger_user); | |
783 continue; | |
784 } | |
785 | |
786 g_free(is_messenger_user); | |
787 } | |
788 | |
789 passport = xmlnode_get_data(passportName); | 790 passport = xmlnode_get_data(passportName); |
790 } | 791 } |
791 | 792 |
792 /* Couldn't find anything */ | 793 /* Couldn't find anything */ |
793 if (passport == NULL) | 794 if (passport == NULL) |
990 g_return_if_fail(session != NULL); | 991 g_return_if_fail(session != NULL); |
991 | 992 |
992 purple_debug_misc("msn", "Got the Address Book!\n"); | 993 purple_debug_misc("msn", "Got the Address Book!\n"); |
993 | 994 |
994 if (msn_parse_addressbook(session, resp->xml)) { | 995 if (msn_parse_addressbook(session, resp->xml)) { |
995 msn_send_privacy(session->account->gc); | 996 msn_send_privacy(purple_account_get_connection(session->account)); |
996 msn_notification_dump_contact(session); | 997 msn_notification_dump_contact(session); |
997 } else { | 998 } else { |
998 /* This is making us loop infinitely when we fail to parse the | 999 /* This is making us loop infinitely when we fail to parse the |
999 address book, disable for now (we should re-enable when we | 1000 address book, disable for now (we should re-enable when we |
1000 send timestamps) | 1001 send timestamps) |
1273 if (user->invite_message) { | 1274 if (user->invite_message) { |
1274 char *tmp; | 1275 char *tmp; |
1275 body = g_markup_escape_text(user->invite_message, -1); | 1276 body = g_markup_escape_text(user->invite_message, -1); |
1276 | 1277 |
1277 /* Ignore the cast, we treat it as const anyway. */ | 1278 /* Ignore the cast, we treat it as const anyway. */ |
1278 tmp = (char *)purple_connection_get_display_name(session->account->gc); | 1279 tmp = (char *)purple_connection_get_display_name(purple_account_get_connection(session->account)); |
1279 tmp = tmp ? g_markup_escape_text(tmp, -1) : g_strdup(""); | 1280 tmp = tmp ? g_markup_escape_text(tmp, -1) : g_strdup(""); |
1280 | 1281 |
1281 invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp); | 1282 invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp); |
1282 | 1283 |
1283 g_free(body); | 1284 g_free(body); |