diff src/protocols/jabber/message.c @ 7345:565b5bca5e8a

[gaim-migrate @ 7936] clearing out my tree committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 27 Oct 2003 05:02:51 +0000
parents 803c7238f6d8
children 66945d35a7c0
line wrap: on
line diff
--- a/src/protocols/jabber/message.c	Mon Oct 27 04:18:44 2003 +0000
+++ b/src/protocols/jabber/message.c	Mon Oct 27 05:02:51 2003 +0000
@@ -460,13 +460,14 @@
 	return 1;
 }
 
-int jabber_message_send_chat(GaimConnection *gc, int id, const char *message)
+int jabber_message_send_chat(GaimConnection *gc, int id, const char *msg)
 {
 	JabberChat *chat;
 	JabberMessage *jm;
 	JabberStream *js = gc->proto_data;
+	char *buf, *xhtml;
 
-	if(!message)
+	if(!msg)
 		return 0;
 
 	chat = jabber_chat_find_by_id(js, id);
@@ -476,7 +477,15 @@
 	jm->type = JABBER_MESSAGE_CHAT;
 	jm->to = g_strdup_printf("%s@%s", chat->room, chat->server);
 
-	gaim_markup_html_to_xhtml(message, &jm->xhtml, &jm->body);
+	buf = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body>%s</body></html>", msg);
+
+	gaim_markup_html_to_xhtml(buf, &xhtml, &jm->body);
+	g_free(buf);
+
+	if(chat->xhtml)
+		jm->xhtml = xhtml;
+	else
+		g_free(xhtml);
 
 	jabber_message_send(jm);
 	jabber_message_free(jm);