changeset 30746:c492cef26b88

jabber: Only take the character data from a <body/> element (non-XHTML) rfc3921 and draft-ietf-xmpp-3921bis talk about the XML character data of the <body/> and 3921bis also says it MUST NOT contain mixed content (see 3.2.2 of the XML 1.0 spec). This should fix Google Talk's private chats showing an empty line whenever someone joins/leaves (caused by some ugly XMPP traffic from Google), and seems correct to me otherwise. This was changed from _get_data to _to_str 7 years ago in 76319226b46e6e64b1ef61933baeb43a5a484a61.
author Paul Aurich <paul@darkrain42.org>
date Sat, 31 Jul 2010 20:39:55 +0000
parents a0d6b85e9c42
children 66c175a474a6
files libpurple/protocols/jabber/message.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c	Sat Jul 31 20:18:59 2010 +0000
+++ b/libpurple/protocols/jabber/message.c	Sat Jul 31 20:39:55 2010 +0000
@@ -246,6 +246,8 @@
 		}
 	}
 
+	purple_debug_warning("jabber CHAT", "MUC message: '%s', '%s'\n",
+	                     jm->xhtml, jm->body);
 	if(jm->xhtml || jm->body) {
 		if(jid->resource)
 			serv_got_chat_in(jm->js->gc, chat->id, jid->resource,
@@ -587,7 +589,7 @@
 				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);
+				char *msg = xmlnode_get_data(child);
 				jm->body = purple_strdup_withhtml(msg);
 				g_free(msg);
 			}