X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgident.cpp;h=2112e45a3f8d298c6f0e47a4bde6e066d25d920e;hb=fc4fc43ec232407b38d7ca182cb92c5cac4287aa;hp=c8d4be4a0a713891d2c7c440b7d1914a4cea3a35;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index c8d4be4a0..2112e45a3 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -31,6 +31,7 @@ class CommandChgident : public Command public: CommandChgident(Module* Creator) : Command(Creator,"CHGIDENT", 2) { + allow_empty_last_param = false; flags_needed = 'o'; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); @@ -40,7 +41,7 @@ class CommandChgident : public Command { User* dest = ServerInstance->FindNick(parameters[0]); - if (!dest) + if ((!dest) || (dest->registered != REG_ALL)) { user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; @@ -86,7 +87,11 @@ class ModuleChgIdent : public Module public: ModuleChgIdent() : cmd(this) { - ServerInstance->AddCommand(&cmd); + } + + void init() + { + ServerInstance->Modules->AddService(cmd); } virtual ~ModuleChgIdent()