]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgident.cpp
Merge pull request #1169 from SaberUK/insp20+fix-makefile
[user/henk/code/inspircd.git] / src / modules / m_chgident.cpp
index 14af298295a126ae4ac77349c8b7a1747d9b8b32..2112e45a3f8d298c6f0e47a4bde6e066d25d920e 100644 (file)
@@ -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 = "<nick> <newident>";
                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;
@@ -90,7 +91,7 @@ public:
 
        void init()
        {
-               ServerInstance->AddCommand(&cmd);
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual ~ModuleChgIdent()