*/
-/* $ModDesc: Provides a SATOPIC command */
-
#include "inspircd.h"
/** Handle /SATOPIC
if(target)
{
- std::string newTopic = parameters[1];
-
- // 3rd parameter overrides access checks
- target->SetTopic(user, newTopic, true);
+ const std::string& newTopic = parameters[1];
+ target->SetTopic(user, newTopic);
ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
return CMD_SUCCESS;
}
else
{
- user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str());
return CMD_FAILURE;
}
}
public:
ModuleSATopic()
: cmd(this)
- {
- ServerInstance->AddCommand(&cmd);
- }
-
- virtual ~ModuleSATopic()
{
}
- virtual Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides a SATOPIC command", VF_VENDOR);
}