cpw.qulogic.msnp16: e3da5362: Attempt to parse any EndpointData out of...
qulogic at pidgin.im
qulogic at pidgin.im
Mon Dec 14 02:29:43 EST 2009
-----------------------------------------------------------------
Revision: e3da5362fc53b50f515b470f01e5af75e856bb63
Ancestor: ce4fd4d13bc6f8677ee5118bd68b3c89d06a7ffa
Author: qulogic at pidgin.im
Date: 2009-12-09T21:44:06
Branch: im.pidgin.cpw.qulogic.msnp16
URL: http://d.pidgin.im/viewmtn/revision/info/e3da5362fc53b50f515b470f01e5af75e856bb63
Modified files:
libpurple/protocols/msn/notification.c
ChangeLog:
Attempt to parse any EndpointData out of the UBX payload. This isn't really
tested out yet.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c 59cefed3c0434ef41752ed9f3c56fbedbacf9837
+++ libpurple/protocols/msn/notification.c 90e6fb4ae50810221ba54a6256f8788d4c04206d
@@ -1612,6 +1612,40 @@ sbs_cmd(MsnCmdProc *cmdproc, MsnCommand
/*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 @@ ubx_cmd_post(MsnCmdProc *cmdproc, MsnCom
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);
More information about the Commits
mailing list