Save PrivateEndpointData that we've received. I think this only applies to cpw.qulogic.msnp16

Tue, 15 Dec 2009 02:05:32 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Tue, 15 Dec 2009 02:05:32 +0000
branch
cpw.qulogic.msnp16
changeset 29445
3ffef687de8a
parent 29444
09f82938321c
child 29446
2a1030761e57

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.

libpurple/protocols/msn/notification.c file | annotate | diff | comparison | revisions
libpurple/protocols/msn/user.c file | annotate | diff | comparison | revisions
libpurple/protocols/msn/user.h file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/notification.c	Tue Dec 15 01:42:24 2009 +0000
+++ b/libpurple/protocols/msn/notification.c	Tue Dec 15 02:05:32 2009 +0000
@@ -1671,6 +1671,41 @@
 
 		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);
+				}
+			}
+		}
+	}
 }
 
 /*
--- a/libpurple/protocols/msn/user.c	Tue Dec 15 01:42:24 2009 +0000
+++ b/libpurple/protocols/msn/user.c	Tue Dec 15 02:05:32 2009 +0000
@@ -243,6 +243,7 @@
 free_user_endpoint(MsnUserEndpoint *data)
 {
 	g_free(data->id);
+	g_free(data->name);
 	g_free(data);
 }
 
--- a/libpurple/protocols/msn/user.h	Tue Dec 15 01:42:24 2009 +0000
+++ b/libpurple/protocols/msn/user.h	Tue Dec 15 02:05:32 2009 +0000
@@ -116,6 +116,8 @@
  */
 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 */
 

mercurial