changeset 30665:60688353c010

Attempt to parse any EndpointData out of the UBX payload. This isn't really tested out yet.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 09 Dec 2009 21:44:06 +0000
parents 8c543e70db7f
children 735418d84442
files libpurple/protocols/msn/notification.c
diffstat 1 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c	Wed Dec 09 21:34:48 2009 +0000
+++ b/libpurple/protocols/msn/notification.c	Wed Dec 09 21:44:06 2009 +0000
@@ -1612,6 +1612,40 @@
 	/*get the payload content*/
 }
 
+static void
+parse_user_endpoints(MsnUser *user, xmlnode *payloadNode)
+{
+	xmlnode *epNode, *capsNode;
+	MsnUserEndpoint data;
+	const char *id;
+	char *caps, *tmp;
+
+	for (epNode = xmlnode_get_child(payloadNode, "EndpointData");
+	     epNode;
+	     epNode = xmlnode_get_next_twin(epNode)) {
+		id = xmlnode_get_attrib(epNode, "id");
+		capsNode = xmlnode_get_child(epNode, "Capabilities");
+
+		if (capsNode != NULL) {
+			caps = xmlnode_get_data(capsNode);
+
+			data.clientid = strtoul(caps, &tmp, 10);
+			if (tmp && *tmp)
+				data.extcaps = strtoul(tmp + 1, NULL, 10);
+			else
+				data.extcaps = 0;
+
+			g_free(caps);
+
+		} else {
+			data.clientid = 0;
+			data.extcaps = 0;
+		}
+
+		msn_user_set_endpoint_data(user, id, &data);
+	}
+}
+
 /*
  * Get the UBX's PSM info
  * Post it to the User status
@@ -1668,6 +1702,7 @@
 		g_free(media.artist);
 		g_free(str);
 
+		parse_user_endpoints(user, payloadNode);
 	} else {
 		msn_user_set_statusline(user, NULL);
 		msn_user_set_currentmedia(user, NULL);