# HG changeset patch # User Elliott Sales de Andrade # Date 1222556757 0 # Node ID 998523cbbcb0596498b67354a1b7dbe585674c17 # Parent 345ed41d807be45e568dbe27e7d50aafbd34b6cb# Parent 43164dadf9225756688ab84762f51cf110355a30 merge of '2138d13a6116de36a5c3cbbb2a323bcbab72017a' and 'a77a8a85e623af608434736b9e63cc17507ec60c' diff -r 43164dadf922 -r 998523cbbcb0 libpurple/protocols/msn/notification.c --- 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 @@ */ - 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); }