]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Merge branch 'master+writenumeric'
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index eefac00f101743f0ec41c00f44c2cfa0efefb221..163f1f2ebf45abc60cea315a1ad32e2d751d9c91 100644 (file)
@@ -39,7 +39,7 @@ class CommandChghost : public Command
        {
                const char* x = parameters[1].c_str();
 
-               if (parameters[1].length() > 63)
+               if (parameters[1].length() > ServerInstance->Config->Limits.MaxHost)
                {
                        user->WriteNotice("*** CHGHOST: Host too long");
                        return CMD_FAILURE;
@@ -56,9 +56,10 @@ class CommandChghost : public Command
 
                User* dest = ServerInstance->FindNick(parameters[0]);
 
-               if ((!dest) || (dest->registered != REG_ALL))
+               // Allow services to change the host of unregistered users
+               if ((!dest) || ((dest->registered != REG_ALL) && (!user->server->IsULine())))
                {
-                       user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str());
+                       user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
                        return CMD_FAILURE;
                }