diff src/protocols/jabber/jabber.c @ 5174:376349b04123

[gaim-migrate @ 5538] made jabber xhtml stuff even better, and fixed a couple bugs in the process committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 19 Apr 2003 06:28:40 +0000
parents 381da05cb5ed
children fefad67de2c7
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Sat Apr 19 01:07:17 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Sat Apr 19 06:28:40 2003 +0000
@@ -2290,6 +2290,8 @@
 	struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1);
 	char *loginname = create_valid_jid(account->username, DEFAULT_SERVER, "Gaim");
 
+	gc->flags |= OPT_CONN_HTML;
+
 	jd->buddies = g_hash_table_new(g_str_hash, g_str_equal);
 	jd->chats = NULL;	/* we have no chats yet */
 
@@ -3381,11 +3383,18 @@
 		/* oh goody. Gaim is telling us what to do. */
 		if (message) {
 			/* Gaim wants us to be away */
+			char *stripped;
+
+			/* Jabber supports XHTML in IMs, but not in away messages. */
+			html_to_xhtml(message, NULL, &stripped);
+
 			y = xmlnode_insert_tag(x, "show");
 			xmlnode_insert_cdata(y, "away", -1);
 			y = xmlnode_insert_tag(x, "status");
-			xmlnode_insert_cdata(y, message, -1);
-			gc->away = g_strdup(message);
+			xmlnode_insert_cdata(y, stripped, -1);
+
+			gc->away = g_strdup(stripped);
+			g_free(stripped);
 		} else {
 			/* Gaim wants us to not be away */
 			/* but for Jabber, we can just send presence with no other information. */