X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_satopic.cpp;h=f966d6a5ad16bb8f69f8f8976a578e2829146559;hb=ae2748c16b6f6feb64d769fe6cef5ea069dbef37;hp=040d86b9a46b68cf1e9bf09b79d4d7043e7457c2;hpb=761e6d75ba37b984998952940ed681e79e456142;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 040d86b9a..f966d6a5a 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -38,8 +38,14 @@ class CommandSATopic : public Command if(target) { - const std::string& newTopic = parameters[1]; - target->SetTopic(user, newTopic); + const std::string newTopic(parameters[1], 0, ServerInstance->Config->Limits.MaxTopic); + if (target->topic == newTopic) + { + user->WriteNotice(InspIRCd::Format("The topic on %s is already what you are trying to change it to.", target->name.c_str())); + return CMD_SUCCESS; + } + + target->SetTopic(user, newTopic, ServerInstance->Time(), NULL); ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic); return CMD_SUCCESS;