# HG changeset patch # User Mark Doliner # Date 1080255457 0 # Node ID 534b479692d05ae836f6b47c8422319a9ec9d50f # Parent 4c3ec649fd7dd8fe807053db0617ae73fb33ea31 [gaim-migrate @ 9240] Patch to make IRC topics such as "Gaim > Oranges" display correctly in conversation windows. This is from A. C. Li, I think. Right? In any case, thanks to the author committer: Tailor Script diff -r 4c3ec649fd7d -r 534b479692d0 src/protocols/irc/cmds.c --- a/src/protocols/irc/cmds.c Thu Mar 25 06:51:51 2004 +0000 +++ b/src/protocols/irc/cmds.c Thu Mar 25 22:57:37 2004 +0000 @@ -23,8 +23,10 @@ #include "internal.h" #include "conversation.h" +#include "debug.h" #include "notify.h" -#include "debug.h" +#include "util.c" + #include "irc.h" @@ -462,9 +464,11 @@ if (!args[0]) { topic = gaim_conv_chat_get_topic (GAIM_CONV_CHAT(convo)); - if (topic) - buf = g_strdup_printf(_("current topic is: %s"), topic); - else + if (topic) { + char *tmp = gaim_escape_html(topic); + buf = g_strdup_printf(_("current topic is: %s"), tmp); + g_free(tmp); + } else buf = g_strdup(_("No topic is set")); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), target, buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL)); g_free(buf); diff -r 4c3ec649fd7d -r 534b479692d0 src/protocols/irc/msgs.c --- a/src/protocols/irc/msgs.c Thu Mar 25 06:51:51 2004 +0000 +++ b/src/protocols/irc/msgs.c Thu Mar 25 22:57:37 2004 +0000 @@ -255,7 +255,7 @@ void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args) { - char *chan, *topic, *msg, *nick; + char *chan, *topic, *msg, *nick, *tmp; GaimConversation *convo; if (!strcmp(name, "topic")) { @@ -272,17 +272,19 @@ } gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, topic); /* If this is an interactive update, print it out */ + tmp = gaim_escape_html(topic); if (!strcmp(name, "topic")) { nick = irc_mask_nick(from); - msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, topic); + msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, tmp); 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, topic); + msg = g_strdup_printf(_("The topic for %s is: %s"), chan, tmp); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", msg, GAIM_MESSAGE_SYSTEM, time(NULL)); g_free(msg); } + g_free(tmp); } void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args)