diff src/protocols/jabber/message.c @ 9762:3f97624e7753

[gaim-migrate @ 10630] nosnilmot writes: This patch auto-linkifies the topic in chats in IRC, Jabber & SILC, so you can now do /topic and get clickable links. Much more fun than copy & paste. This looks a little ugly to me. Too much code seems duplicated. But it was already duplicated, stu just made it do a little more. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Mon, 16 Aug 2004 01:14:58 +0000
parents fe35f55ee984
children a3a540ed2518
line wrap: on
line diff
--- a/src/protocols/jabber/message.c	Sun Aug 15 23:28:09 2004 +0000
+++ b/src/protocols/jabber/message.c	Mon Aug 16 01:14:58 2004 +0000
@@ -168,12 +168,16 @@
 		gaim_conv_chat_set_topic(GAIM_CONV_CHAT(chat->conv), jid->resource,
 				jm->subject);
 		if(!jm->xhtml && !jm->body) {
-			char *msg;
+			char *msg, *tmp, *tmp2;
+			tmp = gaim_escape_html(jm->subject);
+			tmp2 = gaim_markup_linkify(tmp);
 			if(jid->resource)
-				msg = g_strdup_printf(_("%s has set the topic to: %s"), jid->resource, jm->subject);
+				msg = g_strdup_printf(_("%s has set the topic to: %s"), jid->resource, tmp2);
 			else
-				msg = g_strdup_printf(_("The topic is: %s"), jm->subject);
+				msg = g_strdup_printf(_("The topic is: %s"), tmp2);
 			gaim_conv_chat_write(GAIM_CONV_CHAT(chat->conv), "", msg, GAIM_MESSAGE_SYSTEM, jm->sent);
+			g_free(tmp);
+			g_free(tmp2);
 			g_free(msg);
 		}
 	}