diff options
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index dbca108fd..7fa8cb446 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -3311,7 +3311,7 @@ int irc_protocol_cmd_332 (struct t_irc_server *server, const char *command, int argc, char **argv, char **argv_eol) { - char *pos_topic; + char *pos_topic, *topic_no_color, *topic_color; struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; @@ -3327,12 +3327,19 @@ irc_protocol_cmd_332 (struct t_irc_server *server, const char *command, if (ptr_channel && ptr_channel->nicks) { - irc_channel_set_topic (ptr_channel, pos_topic); + topic_no_color = (weechat_config_boolean (irc_config_network_colors_receive)) ? + NULL : irc_color_decode (pos_topic, 0); + irc_channel_set_topic (ptr_channel, + (topic_no_color) ? topic_no_color : pos_topic); + if (topic_no_color) + free (topic_no_color); ptr_buffer = ptr_channel->buffer; } else ptr_buffer = server->buffer; - + + topic_color = irc_color_decode (pos_topic, + (weechat_config_boolean (irc_config_network_colors_receive)) ? 1 : 0); weechat_printf_tags (ptr_buffer, irc_protocol_tags (command, "irc_numeric"), _("%sTopic for %s%s%s is \"%s%s\""), @@ -3341,8 +3348,10 @@ irc_protocol_cmd_332 (struct t_irc_server *server, const char *command, IRC_COLOR_CHAT_CHANNEL, argv[3], IRC_COLOR_CHAT, - pos_topic, + (topic_color) ? topic_color : pos_topic, IRC_COLOR_CHAT); + if (topic_color) + free (topic_color); return WEECHAT_RC_OK; } @@ -4387,7 +4396,7 @@ irc_protocol_recv_command (struct t_irc_server *server, const char *entire_line, { "329", /* channel creation date */ 1, &irc_protocol_cmd_329 }, { "330", /* is logged in as */ 1, &irc_protocol_cmd_330 }, { "331", /* no topic for channel */ 1, &irc_protocol_cmd_331 }, - { "332", /* topic of channel */ 1, &irc_protocol_cmd_332 }, + { "332", /* topic of channel */ 0, &irc_protocol_cmd_332 }, { "333", /* infos about topic (nick and date changed) */ 1, &irc_protocol_cmd_333 }, { "338", /* whois (host) */ 1, &irc_protocol_cmd_338 }, { "341", /* inviting */ 1, &irc_protocol_cmd_341 }, |