cpw.qulogic.msnp16: 71aa8cce: Save PrivateEndpointData that we've rece...
qulogic at pidgin.im
qulogic at pidgin.im
Tue Dec 15 04:01:56 EST 2009
-----------------------------------------------------------------
Revision: 71aa8cce403f7dcb984c90bffbdff573e166afa7
Ancestor: 64ad57ff7117b6e3420ddc81e1e503624ec2c721
Author: qulogic at pidgin.im
Date: 2009-12-15T02:05:32
Branch: im.pidgin.cpw.qulogic.msnp16
URL: http://d.pidgin.im/viewmtn/revision/info/71aa8cce403f7dcb984c90bffbdff573e166afa7
Modified files:
libpurple/protocols/msn/notification.c
libpurple/protocols/msn/user.c
libpurple/protocols/msn/user.h
ChangeLog:
Save PrivateEndpointData that we've received. I think this only applies to
ourselves, so only check if it's our own UBX. This currently only makes use
of the endpoint name and type.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c c965d4d232f0da3172a8f0506d7c910972a3eaf2
+++ libpurple/protocols/msn/notification.c 9df70c4a103c7112dda43bff6b2bb0213459ce71
@@ -1671,6 +1671,41 @@ parse_user_endpoints(MsnUser *user, xmln
msn_user_set_endpoint_data(user, id, &data);
}
+
+ /* Need to shortcut this check, probably... */
+ if (user == user->userlist->session->user) {
+ for (epNode = xmlnode_get_child(payloadNode, "PrivateEndpointData");
+ epNode;
+ epNode = xmlnode_get_next_twin(epNode)) {
+ MsnUserEndpoint *ep;
+ xmlnode *nameNode, *clientNode;
+
+ /* <PrivateEndpointData id='{GUID}'>
+ <EpName>Endpoint Name</EpName>
+ <Idle>true/false</Idle>
+ <ClientType>1</ClientType>
+ <State>NLN</State>
+ </PrivateEndpointData>
+ */
+ id = xmlnode_get_attrib(epNode, "id");
+ ep = msn_user_get_endpoint_data(user, id);
+
+ if (ep != NULL) {
+ nameNode = xmlnode_get_child(epNode, "EpName");
+ if (nameNode != NULL) {
+ g_free(ep->name);
+ ep->name = xmlnode_get_data(nameNode);
+ }
+
+ clientNode = xmlnode_get_child(epNode, "ClientType");
+ if (clientNode != NULL) {
+ tmp = xmlnode_get_data(clientNode);
+ ep->type = strtoul(tmp, 10, NULL);
+ g_free(tmp);
+ }
+ }
+ }
+ }
}
/*
============================================================
--- libpurple/protocols/msn/user.c 5372a3a45b8077cf268845cc712e84bf8fdab675
+++ libpurple/protocols/msn/user.c 3c2b12e4a1f935d4f90dd2c0a927b35d93977472
@@ -243,6 +243,7 @@ free_user_endpoint(MsnUserEndpoint *data
free_user_endpoint(MsnUserEndpoint *data)
{
g_free(data->id);
+ g_free(data->name);
g_free(data);
}
============================================================
--- libpurple/protocols/msn/user.h a5d58257345a21e1d81fcd02d5c84b2a2017f3b6
+++ libpurple/protocols/msn/user.h 87f741880186d48c9d880aff91a324ac4280eb8c
@@ -116,6 +116,8 @@ typedef struct MsnUserEndpoint {
*/
typedef struct MsnUserEndpoint {
char *id; /**< The client's endpoint ID */
+ char *name; /**< The client's endpoint's name */
+ int type; /**< The client's endpoint type */
guint clientid; /**< The client's ID */
guint extcaps; /**< The client's extended capabilites */
More information about the Commits
mailing list