# HG changeset patch # User Mark Doliner # Date 1208416186 0 # Node ID 8f4f88e03efb4836f6085fbc354f2dd9c4868093 # Parent a7ef2c82d1255158efb6c7501945b9df098cef76# Parent dfb1cf26e0c876829ebb17fe1e01fa04b9a86a2f merge of '946d948a1aa4270fa46dabca767e9d727d4519eb' and '949fb9967a8d4bcae83af4ebc6b2681f26b17f5a' diff -r a7ef2c82d125 -r 8f4f88e03efb libpurple/protocols/bonjour/jabber.c --- a/libpurple/protocols/bonjour/jabber.c Thu Apr 17 00:39:01 2008 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Thu Apr 17 07:09:46 2008 +0000 @@ -114,6 +114,28 @@ return "1"; } +static gchar * +get_xmlnode_contents(xmlnode *node) +{ + gchar *contents; + + contents = xmlnode_to_str(node, NULL); + + /* we just want the stuff inside + * There isn't stuff exposed in xmlnode.c to do this more cleanly. */ + + if (contents) { + char *bodystart = strchr(contents, '>'); + char *bodyend = strrchr(bodystart, '<'); + if (bodystart && bodyend && (bodystart + 1) != bodyend) { + *bodyend = '\0'; + memmove(contents, bodystart + 1, (bodyend - bodystart)); + } + } + + return contents; +} + static void _jabber_parse_and_write_message_to_ui(xmlnode *message_node, PurpleBuddy *pb) { @@ -167,7 +189,7 @@ if (font_size != NULL) font_size = _font_size_ichat_to_purple(atoi(font_size)); font_color = xmlnode_get_attrib(html_body_font_node, "color"); - html_body = xmlnode_get_data(html_body_font_node); + html_body = get_xmlnode_contents(html_body_font_node); if (html_body == NULL) /* This is the kind of formated messages that Purple creates */