X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgident.cpp;h=2ef44c684ce762ec4eda10ee06e6305270d8bf8f;hb=8790551dc182cd8804ee7d8ef89ccb31067cc2a4;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..2ef44c684 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; @@ -78,7 +79,6 @@ class CommandChgident : public Command } }; - class ModuleChgIdent : public Module { CommandChgident cmd; @@ -86,11 +86,11 @@ class ModuleChgIdent : public Module public: ModuleChgIdent() : cmd(this) { - ServerInstance->AddCommand(&cmd); } - virtual ~ModuleChgIdent() + void init() { + ServerInstance->Modules->AddService(cmd); } virtual Version GetVersion() @@ -101,4 +101,3 @@ public: }; MODULE_INIT(ModuleChgIdent) -