diff libpurple/protocols/msn/contact.c @ 32533:e091c8ea292e

Pluck all MSNP18 changes. This is pretty much to fix sending OIMs. *** Plucked rev b8b574c4d6f6c05105b372191ca5259b4ae0ad41 (qulogic@pidgin.im): Add a function for parsing a network:username for MSNP18. *** Plucked rev 86bb401efa33f02ca5d28fea216a39a3cf29b5b4 (qulogic@pidgin.im): Fix UBX on MSNP18. *** Plucked rev ba2513694e6abcbdfddc66820f1df20540a36847 (qulogic@pidgin.im): Fix NLN on MSNP18. *** Plucked rev 83a617670da618f4dbdeeebbdb5e2813a4ad2c0c (qulogic@pidgin.im): Switch to ABFindContactsPaged instead of ABFindAll. *** Plucked rev b6bd214d29db885c6d28628c163fa144bdf4a76d (qulogic@pidgin.im): Send circle authentication on the notification server on MSNP18. *** Plucked rev 2ca50146aa67469313579cea414e4a2b660939aa (qulogic@pidgin.im): Make a small name change. *** Plucked rev 2c13bf358104060d6713317e18e03b434862cb38 (qulogic@pidgin.im): Add a missing function. *** Plucked rev a8deb3f73726f4148e8f36f317a88fedcb051c34 (qulogic@pidgin.im): Update UUM to allow sending to users on any network. *** Plucked rev dddff988e830a7a2fa0e40aad200f0e908b9231e (qulogic@pidgin.im): Switch to MSNP18. *** Plucked rev 9fe45819000c530c509c07b7feb29ce9d4ea13b0 (qulogic@pidgin.im): Send offline messages using UUM. *** Plucked rev c1584182b85f99fa3507ea3f76b07865ee7e43f7 (qulogic@pidgin.im): Drop support for protocols below 18. *** Plucked rev f0388e54998489dbe4b6133796f77459f20fe884 (qulogic@pidgin.im): Fix indices for client capabilities and display pics.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 22 Feb 2012 05:52:30 +0000
parents 9eb5b85c7089
children e10e419e6067 01ff09d4a463
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Wed Feb 22 05:32:14 2012 +0000
+++ b/libpurple/protocols/msn/contact.c	Wed Feb 22 05:52:30 2012 +0000
@@ -864,6 +864,21 @@
 	g_free(alias);
 }
 
+static void
+msn_parse_addressbook_circles(MsnSession *session, xmlnode *node)
+{
+	xmlnode *ticket;
+
+	/* TODO: Parse groups */
+
+	ticket = xmlnode_get_child(node, "CircleTicket");
+	if (ticket) {
+		char *data = xmlnode_get_data(ticket);
+		msn_notification_send_circle_auth(session, data);
+		g_free(data);
+	}
+}
+
 static gboolean
 msn_parse_addressbook(MsnSession *session, xmlnode *node)
 {
@@ -871,6 +886,7 @@
 	xmlnode *groups;
 	xmlnode *contacts;
 	xmlnode *abNode;
+	xmlnode *circleNode;
 	xmlnode *fault;
 
 	if ((fault = xmlnode_get_child(node, "Body/Fault"))) {
@@ -897,7 +913,7 @@
 		return FALSE;
 	}
 
-	result = xmlnode_get_child(node, "Body/ABFindAllResponse/ABFindAllResult");
+	result = xmlnode_get_child(node, "Body/ABFindContactsPagedResponse/ABFindContactsPagedResult");
 	if (result == NULL) {
 		purple_debug_misc("msn", "Received no address book update\n");
 		return TRUE;
@@ -906,7 +922,7 @@
 	/* I don't see this "groups" tag documented on msnpiki, need to find out
 	   if they are really there, and update msnpiki */
 	/*Process Group List*/
-	groups = xmlnode_get_child(result, "groups");
+	groups = xmlnode_get_child(result, "Groups");
 	if (groups != NULL) {
 		msn_parse_addressbook_groups(session, groups);
 	}
@@ -931,12 +947,12 @@
 
 	/*Process contact List*/
 	purple_debug_info("msn", "Process contact list...\n");
-	contacts = xmlnode_get_child(result, "contacts");
+	contacts = xmlnode_get_child(result, "Contacts");
 	if (contacts != NULL) {
 		msn_parse_addressbook_contacts(session, contacts);
 	}
 
-	abNode = xmlnode_get_child(result, "ab");
+	abNode = xmlnode_get_child(result, "Ab");
 	if (abNode != NULL) {
 		xmlnode *node2;
 		char *tmp = NULL;
@@ -954,6 +970,11 @@
 		g_free(tmp);
 	}
 
+	circleNode = xmlnode_get_child(result, "CircleResult");
+	if (circleNode != NULL) {
+		msn_parse_addressbook_circles(session, circleNode);
+	}
+
 	return TRUE;
 }