Mercurial > pidgin.yaz
diff libpurple/protocols/msn/notification.c @ 31120:f56126c5aa44
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.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Tue, 15 Dec 2009 02:05:32 +0000 |
parents | fc7798a661f7 |
children | 509c4ffff958 |
line wrap: on
line diff
--- 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); + } + } + } + } } /*