diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-10-06 18:27:48 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-10-06 18:27:48 +0200 |
commit | 55b5130a8725da2e261464ebc93553fe5d0c8512 (patch) | |
tree | 4e53d5a5cbd7e66a5f338174a490dd29e12a68d4 /src | |
parent | 8ba491e427beceecfee1ddbc644b72640e9e2caf (diff) | |
download | weechat-55b5130a8725da2e261464ebc93553fe5d0c8512.zip |
Display old IRC channel topic when topic is unset (task #9780)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 884d1d6d5..5940034a5 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1776,16 +1776,39 @@ IRC_PROTOCOL_CALLBACK(topic) } else { - weechat_printf_tags (ptr_buffer, - irc_protocol_tags (command, NULL), - _("%s%s%s%s has unset topic for %s%s%s"), - weechat_prefix ("network"), - IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), - nick, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_CHANNEL, - argv[2], - IRC_COLOR_CHAT); + if (weechat_config_boolean (irc_config_look_display_old_topic)) + { + old_topic_color = irc_color_decode (ptr_channel->topic, + weechat_config_boolean (irc_config_network_colors_receive)); + weechat_printf_tags (ptr_buffer, + irc_protocol_tags (command, NULL), + _("%s%s%s%s has unset topic for %s%s%s " + "(old topic: \"%s%s\")"), + weechat_prefix ("network"), + IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_CHAT, + (old_topic_color) ? old_topic_color : ptr_channel->topic, + IRC_COLOR_CHAT); + if (old_topic_color) + free (old_topic_color); + } + else + { + weechat_printf_tags (ptr_buffer, + irc_protocol_tags (command, NULL), + _("%s%s%s%s has unset topic for %s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_CHAT); + } } } |