diff options
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); + } } } |