# HG changeset patch # User Elliott Sales de Andrade # Date 1260395046 0 # Node ID 60688353c010fe328fdd40782700ac1de9e592d7 # Parent 8c543e70db7f4218518bc66d1f041fbdf1e2d543 Attempt to parse any EndpointData out of the UBX payload. This isn't really tested out yet. diff -r 8c543e70db7f -r 60688353c010 libpurple/protocols/msn/notification.c --- 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);