From: Nathan W. <fac...@us...> - 2003-10-27 05:06:14
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory sc8-pr-cvs1:/tmp/cvs-serv13824/src/protocols/jabber Modified Files: chat.h message.c Log Message: clearing out my tree Index: chat.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/chat.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- chat.h 29 Sep 2003 15:23:18 -0000 1.1 +++ chat.h 27 Oct 2003 05:02:51 -0000 1.2 @@ -37,6 +37,7 @@ typedef struct _JabberChat { int id; GaimConversation *conv; gboolean muc; + gboolean xhtml; } JabberChat; GList *jabber_chat_info(GaimConnection *gc); Index: message.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/message.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -p -r1.14 -r1.15 --- message.c 26 Oct 2003 04:51:09 -0000 1.14 +++ message.c 27 Oct 2003 05:02:51 -0000 1.15 @@ -460,13 +460,14 @@ int jabber_message_send_im(GaimConnectio 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 @@ int jabber_message_send_chat(GaimConnect 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); |