]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgname.cpp
Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters
[user/henk/code/inspircd.git] / src / modules / m_chgname.cpp
index fa25c52a00bbe5f337d83553f4e9062d0dbc71c4..3ad9cede918b916084c1f076873fa128ace82855 100644 (file)
@@ -39,7 +39,7 @@ class CommandChgname : public Command
 
                if ((!dest) || (dest->registered != REG_ALL))
                {
-                       user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
+                       user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
                        return CMD_FAILURE;
                }
 
@@ -57,7 +57,7 @@ class CommandChgname : public Command
 
                if (IS_LOCAL(dest))
                {
-                       dest->ChangeName(parameters[1].c_str());
+                       dest->ChangeName(parameters[1]);
                        ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGNAME to change %s's GECOS to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->fullname.c_str());
                }
 
@@ -82,16 +82,10 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the CHGNAME command", VF_OPTCOMMON | VF_VENDOR);
        }
-
 };
 
 MODULE_INIT(ModuleChgName)