# HG changeset patch # User Elliott Sales de Andrade # Date 1280619819 0 # Node ID 00851eae12c7ea5c4d56e05da98753ebe8b1a165 # Parent 66c175a474a6ce7f1e1308d1b73836f072923557# Parent e9fbbfe1ab70b7417ef1e334eb871d6e1d3cf277 merge of 'a7d49884941697519567616ac54f4c2884df05e2' and 'e15c002b6cf19a3cf1843b35457ff8b1efa78a5a' diff -r e9fbbfe1ab70 -r 00851eae12c7 libpurple/protocols/jabber/chat.c --- a/libpurple/protocols/jabber/chat.c Sat Jul 31 23:43:37 2010 +0000 +++ b/libpurple/protocols/jabber/chat.c Sat Jul 31 23:43:39 2010 +0000 @@ -173,8 +173,10 @@ xmlnode_set_namespace(x, "http://jabber.org/protocol/muc#user"); invite = xmlnode_new_child(x, "invite"); xmlnode_set_attrib(invite, "to", name); - body = xmlnode_new_child(invite, "reason"); - xmlnode_insert_data(body, msg, -1); + if (msg) { + body = xmlnode_new_child(invite, "reason"); + xmlnode_insert_data(body, msg, -1); + } } else { xmlnode_set_attrib(message, "to", name); /* @@ -184,14 +186,17 @@ * * Left here for compatibility. */ - body = xmlnode_new_child(message, "body"); - xmlnode_insert_data(body, msg, -1); + if (msg) { + body = xmlnode_new_child(message, "body"); + xmlnode_insert_data(body, msg, -1); + } x = xmlnode_new_child(message, "x"); xmlnode_set_attrib(x, "jid", room_jid); /* The better place for it! XEP-0249 style. */ - xmlnode_set_attrib(x, "reason", msg); + if (msg) + xmlnode_set_attrib(x, "reason", msg); xmlnode_set_namespace(x, "jabber:x:conference"); } diff -r e9fbbfe1ab70 -r 00851eae12c7 libpurple/protocols/jabber/message.c --- a/libpurple/protocols/jabber/message.c Sat Jul 31 23:43:37 2010 +0000 +++ b/libpurple/protocols/jabber/message.c Sat Jul 31 23:43:39 2010 +0000 @@ -587,8 +587,10 @@ jm->thread_id = xmlnode_get_data(child); } else if(!strcmp(child->name, "body") && !strcmp(xmlns, NS_XMPP_CLIENT)) { if(!jm->body) { - char *msg = xmlnode_to_str(child, NULL); - jm->body = purple_strdup_withhtml(msg); + char *msg = xmlnode_get_data(child); + char *escaped = purple_markup_escape_text(msg, -1); + jm->body = purple_strdup_withhtml(escaped); + g_free(escaped); g_free(msg); } } else if(!strcmp(child->name, "html") && !strcmp(xmlns, NS_XHTML_IM)) {