Mercurial > pidgin
changeset 24194:998523cbbcb0
merge of '2138d13a6116de36a5c3cbbb2a323bcbab72017a'
and 'a77a8a85e623af608434736b9e63cc17507ec60c'
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 27 Sep 2008 23:05:57 +0000 |
parents | 345ed41d807b (diff) 43164dadf922 (current diff) |
children | dbb87be4d9b6 |
files | |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c Sat Sep 27 11:16:36 2008 +0000 +++ b/libpurple/protocols/msn/notification.c Sat Sep 27 23:05:57 2008 +0000 @@ -306,7 +306,7 @@ * to see the Local ID */ msn_cmdproc_send(cmdproc, "CVR", - "0x0409 winnt 5.1 i386 MSNMSGR 8.5.1288 msmsgs %s", + "0x0409 winnt 5.1 i386 MSNMSGR 8.5.1302 BC01 %s", purple_account_get_username(account)); } @@ -1060,7 +1060,8 @@ { PurpleConnection *gc; MsnUserList *userlist; - char *who = NULL, *text = NULL; + const char *who = NULL; + char *text = NULL; const char *id = NULL; xmlnode *payloadNode, *from, *msg, *textNode; @@ -1104,13 +1105,18 @@ </NOTIFICATION> */ - if (!(payloadNode = xmlnode_from_str(payload, len)) || - !(from = xmlnode_get_child(payloadNode, "FROM")) || - !(msg = xmlnode_get_child(payloadNode, "MSG")) || - !(textNode = xmlnode_get_child(msg, "BODY/TEXT"))) + payloadNode = xmlnode_from_str(payload, len); + if (!payloadNode) return; - who = g_strdup(xmlnode_get_attrib(from, "name")); + if (!(from = xmlnode_get_child(payloadNode, "FROM")) || + !(msg = xmlnode_get_child(payloadNode, "MSG")) || + !(textNode = xmlnode_get_child(msg, "BODY/TEXT"))) { + xmlnode_free(payloadNode); + return; + } + + who = xmlnode_get_attrib(from, "name"); if (!who) return; text = xmlnode_get_data(textNode); @@ -1121,10 +1127,8 @@ MsnUser *user = msn_userlist_find_user_with_mobile_phone(userlist, who + 4); - if(user && user->passport) { - g_free(who); - who = g_strdup(user->passport); - } + if (user && user->passport) + who = user->passport; } id = xmlnode_get_attrib(msg, "id"); @@ -1143,7 +1147,6 @@ } g_free(text); - g_free(who); xmlnode_free(payloadNode); }