pidgin: 6597ee41: Looks like we need to convert the messag...

sadrul at pidgin.im sadrul at pidgin.im
Mon Sep 22 01:20:54 EDT 2008


-----------------------------------------------------------------
Revision: 6597ee41c4b15c89f49616d51fd455267fad4e73
Ancestor: 625fbf7f158fc313ce4d219b02326768e4577645
Author: sadrul at pidgin.im
Date: 2008-09-22T05:30:16
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/6597ee41c4b15c89f49616d51fd455267fad4e73

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

ChangeLog: 

Looks like we need to convert the message into XHTML first. Fixes #7160.

-------------- next part --------------
============================================================
--- libpurple/protocols/bonjour/jabber.c	9079aa3a3729d2e676746acb7241dffca5eef3eb
+++ libpurple/protocols/bonjour/jabber.c	43e9188ac1443114eac67594c10f2b535099a3a2
@@ -946,7 +946,7 @@ bonjour_jabber_send_message(BonjourJabbe
 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 @@ bonjour_jabber_send_message(BonjourJabbe
 		return -10000;
 	}
 
+	purple_markup_html_to_xhtml(body, &xhtml, &message);
+
 	bb = pb->proto_data;
 
 	message_node = xmlnode_new("message");
@@ -967,7 +969,6 @@ bonjour_jabber_send_message(BonjourJabbe
 
 	/* 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 @@ bonjour_jabber_send_message(BonjourJabbe
 	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);
 


More information about the Commits mailing list