pidgin: b06da0c4: If we receive a "text" child for an erro...

evands at pidgin.im evands at pidgin.im
Tue May 20 21:50:54 EDT 2008


-----------------------------------------------------------------
Revision: b06da0c40e8ffb855dcdb0047e94f337c62192a1
Ancestor: d7144f5dbbde09137aff1ceadfd419e25303bf7d
Author: evands at pidgin.im
Date: 2008-05-21T01:45:54
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b06da0c40e8ffb855dcdb0047e94f337c62192a1

Modified files:
        libpurple/protocols/jabber/message.c

ChangeLog: 

If we receive a "text" child for an error, include it as the message text
if the error didn't have its own data section. We might want to use it
preferentially over the child's data section, but I'm not sure.

This significantly improves error messages received when sending messages
over XMPP.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c	3ceab074f381af5ba3b818d7b08a14c864708c76
+++ libpurple/protocols/jabber/message.c	bb0688766b3cbd6ebbbcecf606d53fb6341e9a8f
@@ -403,6 +403,12 @@ void jabber_message_parse(JabberStream *
 			const char *code = xmlnode_get_attrib(child, "code");
 			char *code_txt = NULL;
 			char *text = xmlnode_get_data(child);
+			if (!text) {
+				xmlnode *enclosed_text_node;
+				
+				if ((enclosed_text_node = xmlnode_get_child(child, "text")))
+					text = xmlnode_get_data(enclosed_text_node);
+			}
 
 			if(code)
 				code_txt = g_strdup_printf(_(" (Code %s)"), code);


More information about the Commits mailing list