pidgin: b8e6435c: jabber: Only take the character data fro...

darkrain42 at darkrain42 at
Sat Jul 31 16:45:47 EDT 2010

Revision: b8e6435cda8f181325f88d7a4ee4c2bb11ed648a
Parent:   0e72bb347f64bc411baa5332c8045865628fb170
Author:   darkrain42 at
Date:     07/31/10 16:39:55
Branch:   im.pidgin.pidgin


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

Changes against parent 0e72bb347f64bc411baa5332c8045865628fb170

  patched  libpurple/protocols/jabber/message.c

-------------- next part --------------
--- libpurple/protocols/jabber/message.c	45645a38d429674a2a45c79226aa8ec6b8ea4562
+++ libpurple/protocols/jabber/message.c	049717f56ad476bc62905eda2c7042bfc32cb3f4
@@ -246,6 +246,8 @@ static void handle_groupchat(JabberMessa
+	purple_debug_warning("jabber CHAT", "MUC message: '%s', '%s'\n",
+	                     jm->xhtml, jm->body);
 	if(jm->xhtml || jm->body) {
 			serv_got_chat_in(jm->js->gc, chat->id, jid->resource,
@@ -587,7 +589,7 @@ void jabber_message_parse(JabberStream *
 				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);

More information about the Commits mailing list