X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_setname.cpp;h=d0610853bc4ce7e1308d01616473136b25c8eb98;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=32c1d5dc3c55789db3b53734fd47832fa1f3d6ed;hpb=c570f1d62bd5f371100f7ea02fedf0d7f04d41dd;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index 32c1d5dc3..d0610853b 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[0].empty()) - { - 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()); @@ -65,7 +60,11 @@ class ModuleSetName : public Module ModuleSetName() : cmd(this) { - ServerInstance->AddCommand(&cmd); + } + + void init() + { + ServerInstance->Modules->AddService(cmd); } virtual ~ModuleSetName()