]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgident.cpp
Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters
[user/henk/code/inspircd.git] / src / modules / m_chgident.cpp
index 1c3bf53d3ea8e5d104439383fc138855e081bb93..0b4e78f127628362424e596f7df08082a34faf0a 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides support for the CHGIDENT command */
-
 /** Handle /CHGIDENT
  */
 class CommandChgident : public Command
@@ -34,7 +32,7 @@ class CommandChgident : public Command
                allow_empty_last_param = false;
                flags_needed = 'o';
                syntax = "<nick> <newident>";
-               TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
+               TRANSLATE2(TR_NICK, TR_TEXT);
        }
 
        CmdResult Handle(const std::vector<std::string> &parameters, User *user)
@@ -43,7 +41,7 @@ class CommandChgident : 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;
                }
 
@@ -53,7 +51,7 @@ class CommandChgident : public Command
                        return CMD_FAILURE;
                }
 
-               if (!ServerInstance->IsIdent(parameters[1].c_str()))
+               if (!ServerInstance->IsIdent(parameters[1]))
                {
                        user->WriteNotice("*** CHGIDENT: Invalid characters in ident");
                        return CMD_FAILURE;
@@ -61,9 +59,9 @@ class CommandChgident : public Command
 
                if (IS_LOCAL(dest))
                {
-                       dest->ChangeIdent(parameters[1].c_str());
+                       dest->ChangeIdent(parameters[1]);
 
-                       if (!ServerInstance->ULine(user->server))
+                       if (!user->server->IsULine())
                                ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str());
                }
 
@@ -88,16 +86,10 @@ public:
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the CHGIDENT command", VF_OPTCOMMON | VF_VENDOR);
        }
-
 };
 
 MODULE_INIT(ModuleChgIdent)