changeset 24101:bb8aa63494e7

Looks like we need to convert the message into XHTML first. Fixes #7160.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 22 Sep 2008 05:30:16 +0000
parents 7e85c6cbf7b0
children b5210bb72273 b041a72f8878
files libpurple/protocols/bonjour/jabber.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/jabber.c	Sun Sep 21 23:16:37 2008 +0000
+++ b/libpurple/protocols/bonjour/jabber.c	Mon Sep 22 05:30:16 2008 +0000
@@ -946,7 +946,7 @@
 bonjour_jabber_send_message(BonjourJabber *jdata, const gchar *to, const gchar *body)
 {
 	xmlnode *message_node, *node, *node2;
-	gchar *message;
+	gchar *message, *xhtml;
 	PurpleBuddy *pb;
 	BonjourBuddy *bb;
 	int ret;
@@ -958,6 +958,8 @@
 		return -10000;
 	}
 
+	purple_markup_html_to_xhtml(body, &xhtml, &message);
+
 	bb = pb->proto_data;
 
 	message_node = xmlnode_new("message");
@@ -967,7 +969,6 @@
 
 	/* Enclose the message from the UI within a "font" node */
 	node = xmlnode_new_child(message_node, "body");
-	message = purple_markup_strip_html(body);
 	xmlnode_insert_data(node, message, strlen(message));
 	g_free(message);
 
@@ -975,8 +976,9 @@
 	xmlnode_set_namespace(node, "http://www.w3.org/1999/xhtml");
 
 	node = xmlnode_new_child(node, "body");
-	message = g_strdup_printf("<font>%s</font>", body);
+	message = g_strdup_printf("<font>%s</font>", xhtml);
 	node2 = xmlnode_from_str(message, strlen(message));
+	g_free(xhtml);
 	g_free(message);
 	xmlnode_insert_child(node, node2);