changeset 23073:e765c7261f88

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.
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 21 May 2008 01:45:54 +0000
parents af577b5a6aac
children e4f5a65d9a77
files libpurple/protocols/jabber/message.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c	Wed May 07 09:11:24 2008 +0000
+++ b/libpurple/protocols/jabber/message.c	Wed May 21 01:45:54 2008 +0000
@@ -403,6 +403,12 @@
 			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);