diff --git a/doc/ircd.conf.example b/doc/ircd.conf.example index 2a45554f..5f03d4d3 100755 --- a/doc/ircd.conf.example +++ b/doc/ircd.conf.example @@ -367,6 +367,7 @@ channel { disable_local_channels = no; autochanmodes = "+nt"; displayed_usercount = 3; + strip_topic_colors = no; }; serverhide { diff --git a/doc/reference.conf b/doc/reference.conf index 82f42b94..c4457a9d 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -822,6 +822,9 @@ channel { * such as LIST >0. */ displayed_usercount = 3; + + /* strip_topic_colors: whether or not color codes in TOPIC should be stripped. */ + strip_topic_colors = no; }; diff --git a/include/s_conf.h b/include/s_conf.h index 3e71f715..fa490b6e 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -263,6 +263,7 @@ struct config_channel_entry int disable_local_channels; unsigned int autochanmodes; int displayed_usercount; + int strip_topic_colors; }; struct config_server_hide diff --git a/ircd/channel.c b/ircd/channel.c index 9bc684b4..6caf9fcb 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -43,6 +43,7 @@ #include "logger.h" #include "ipv4_from_ipv6.h" #include "s_assert.h" +#include "inline/stringops.h" struct config_channel_entry ConfigChannel; rb_dlink_list global_channel_list; @@ -1158,6 +1159,9 @@ set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_in rb_strlcpy(chptr->topic, topic, TOPICLEN + 1); rb_strlcpy(chptr->topic_info, topic_info, USERHOST_REPLYLEN); chptr->topic_time = topicts; + + if (ConfigChannel.strip_topic_colors) + strip_colour(chptr->topic); } else { diff --git a/ircd/newconf.c b/ircd/newconf.c index 15f10673..19b9d24d 100644 --- a/ircd/newconf.c +++ b/ircd/newconf.c @@ -2456,6 +2456,7 @@ static struct ConfEntry conf_channel_table[] = { "disable_local_channels", CF_YESNO, NULL, 0, &ConfigChannel.disable_local_channels }, { "autochanmodes", CF_QSTRING, conf_set_channel_autochanmodes, 0, NULL }, { "displayed_usercount", CF_INT, NULL, 0, &ConfigChannel.displayed_usercount }, + { "strip_topic_colors", CF_YESNO, NULL, 0, &ConfigChannel.strip_topic_colors }, { "\0", 0, NULL, 0, NULL } };