]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgident.cpp
Fix dccallow to work with files with spaces in their names
[user/henk/code/inspircd.git] / src / modules / m_chgident.cpp
index c8d4be4a0a713891d2c7c440b7d1914a4cea3a35..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;
@@ -86,7 +87,11 @@ class ModuleChgIdent : public Module
 public:
        ModuleChgIdent() : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual ~ModuleChgIdent()