X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_channel%2Fcmd_topic.cpp;h=6d99edcc6eeb1176880312bf2d7b0ee6cd3c21e5;hb=b200104cf2c61465acecaca111e3ec727fc3b954;hp=b421489399953867c169af5712d60a418d5e9d05;hpb=761e6d75ba37b984998952940ed681e79e456142;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp index b42148939..6d99edcc6 100644 --- a/src/coremods/core_channel/cmd_topic.cpp +++ b/src/coremods/core_channel/cmd_topic.cpp @@ -80,7 +80,13 @@ CmdResult CommandTopic::HandleLocal(const std::vector& parameters, } } - c->SetTopic(user, t); + // Make sure the topic is not longer than the limit in the config + if (t.length() > ServerInstance->Config->Limits.MaxTopic) + t.erase(ServerInstance->Config->Limits.MaxTopic); + + // Only change if the new topic is different than the current one + if (c->topic != t) + c->SetTopic(user, t, ServerInstance->Time()); return CMD_SUCCESS; }