diff src/protocols/irc/msgs.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 b10d4c6ac7eb
children 62eb9fe24692
line wrap: on
line diff
--- a/src/protocols/irc/msgs.c	Sun Aug 15 23:28:09 2004 +0000
+++ b/src/protocols/irc/msgs.c	Mon Aug 16 01:14:58 2004 +0000
@@ -260,7 +260,7 @@
 
 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
-	char *chan, *topic, *msg, *nick, *tmp;
+	char *chan, *topic, *msg, *nick, *tmp, *tmp2;
 	GaimConversation *convo;
 
 	if (!strcmp(name, "topic")) {
@@ -278,20 +278,22 @@
 
 	/* If this is an interactive update, print it out */
 	tmp = gaim_escape_html(topic);
+	tmp2 = gaim_markup_linkify(tmp);
+	g_free(tmp);
 	if (!strcmp(name, "topic")) {
 		nick = irc_mask_nick(from);
 		gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), nick, topic);
-		msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, tmp);
+		msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, tmp2);
 		g_free(nick);
 		gaim_conv_chat_write(GAIM_CONV_CHAT(convo), from, msg, GAIM_MESSAGE_SYSTEM, time(NULL));
 		g_free(msg);
 	} else {
-		msg = g_strdup_printf(_("The topic for %s is: %s"), chan, tmp);
+		msg = g_strdup_printf(_("The topic for %s is: %s"), chan, tmp2);
 		gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, topic);
 		gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", msg, GAIM_MESSAGE_SYSTEM, time(NULL));
 		g_free(msg);
 	}
-	g_free(tmp);
+	g_free(tmp2);
 	g_free(topic);
 }