# HG changeset patch # User Luke Schierer # Date 1089661085 0 # Node ID 6c24a6f0725667e37759a125b4ae1fead1601757 # Parent 0524b36c701aeea0ca4e37b0aeaf2d6a833e7cba [gaim-migrate @ 10345] " Updates irc and silc to pass the topic setter to gaim_conv_chat_set_topic. Theres more code duplication in here than I would like, but it's better than adding another var and adding more conditionals.." --Gary Kramlich committer: Tailor Script diff -r 0524b36c701a -r 6c24a6f07256 src/protocols/irc/msgs.c --- a/src/protocols/irc/msgs.c Mon Jul 12 19:37:07 2004 +0000 +++ b/src/protocols/irc/msgs.c Mon Jul 12 19:38:05 2004 +0000 @@ -270,17 +270,19 @@ if (!convo) { gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan); } - 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); + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), 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, tmp); + 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); } diff -r 0524b36c701a -r 6c24a6f07256 src/protocols/silc/ops.c --- a/src/protocols/silc/ops.c Mon Jul 12 19:37:07 2004 +0000 +++ b/src/protocols/silc/ops.c Mon Jul 12 19:38:05 2004 +0000 @@ -334,6 +334,8 @@ client_entry->nickname, channel->channel_name, tmp); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), client_entry->nickname, buf, GAIM_MESSAGE_SYSTEM, time(NULL)); + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), + client_entry->nickname, tmp); } else if (idtype == SILC_ID_SERVER) { server_entry = (SilcServerEntry)entry; g_snprintf(buf, sizeof(buf), @@ -341,6 +343,8 @@ server_entry->server_name, channel->channel_name, tmp); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), server_entry->server_name, buf, GAIM_MESSAGE_SYSTEM, time(NULL)); + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), + server_entry->server_name, tmp); } else if (idtype == SILC_ID_CHANNEL) { channel = (SilcChannelEntry)entry; g_snprintf(buf, sizeof(buf), @@ -348,10 +352,12 @@ channel->channel_name, channel->channel_name, tmp); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), channel->channel_name, buf, GAIM_MESSAGE_SYSTEM, time(NULL)); + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), + channel->channel_name, tmp); + } else { + gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, tmp); } - gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, tmp); - break; case SILC_NOTIFY_TYPE_NICK_CHANGE: