X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_setname.cpp;h=28fd27f95c7efc42271243259513e2387181edf2;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=0d6b1d9f3f55237e506e5c6715545e196935ce3f;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index 0d6b1d9f3..28fd27f95 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -30,18 +30,13 @@ class CommandSetname : public Command public: CommandSetname(Module* Creator) : Command(Creator,"SETNAME", 1, 1) { + allow_empty_last_param = false; syntax = ""; TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle (const std::vector& parameters, User *user) { - if (parameters.size() == 0) - { - user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick.c_str()); - return CMD_FAILURE; - } - if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos) { user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick.c_str()); @@ -50,8 +45,7 @@ class CommandSetname : public Command if (user->ChangeName(parameters[0].c_str())) { - ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to %s", user->nick.c_str(), parameters[0].c_str()); - return CMD_SUCCESS; + ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to '%s'", user->nick.c_str(), parameters[0].c_str()); } return CMD_SUCCESS; @@ -66,11 +60,11 @@ class ModuleSetName : public Module ModuleSetName() : cmd(this) { - ServerInstance->AddCommand(&cmd); } - virtual ~ModuleSetName() + void init() { + ServerInstance->Modules->AddService(cmd); } virtual Version GetVersion()