diff --git a/ircd/channel.c b/ircd/channel.c index 6caf9fcb..9bc684b4 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -43,7 +43,6 @@ #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; @@ -1159,9 +1158,6 @@ 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/modules/m_topic.c b/modules/m_topic.c index c2c37f85..f6a79fc4 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -41,6 +41,7 @@ #include "packet.h" #include "tgchange.h" #include "logger.h" +#include "inline/stringops.h" static int m_topic(struct Client *, struct Client *, int, const char **); static int ms_topic(struct Client *, struct Client *, int, const char **); @@ -123,10 +124,16 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * (!MyClient(source_p) || can_send(chptr, source_p, msptr))) { + char topic[TOPICLEN + 1]; char topic_info[USERHOST_REPLYLEN]; + rb_strlcpy(topic, parv[2], sizeof(topic)); rb_sprintf(topic_info, "%s!%s@%s", source_p->name, source_p->username, source_p->host); - set_channel_topic(chptr, parv[2], topic_info, rb_current_time()); + + if (ConfigChannel.strip_topic_colors) + strip_colour(topic); + + set_channel_topic(chptr, topic, topic_info, rb_current_time()); sendto_server(client_p, chptr, CAP_TS6, NOCAPS, ":%s TOPIC %s :%s",