]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_setident.cpp
Accept std::string as parameter in User::ChangeHost(), ChangeIdent() and ChangeName()
[user/henk/code/inspircd.git] / src / modules / m_setident.cpp
index f63be1381bb2ecee0ebc61142ac4916922280b55..024421347e94370decd8a65a9effd8fec26e314f 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides support for the SETIDENT command */
-
 /** Handle /SETIDENT
  */
 class CommandSetident : public Command
@@ -33,31 +31,29 @@ class CommandSetident : public Command
        {
                allow_empty_last_param = false;
                flags_needed = 'o'; syntax = "<new-ident>";
-               TRANSLATE2(TR_TEXT, TR_END);
        }
 
        CmdResult Handle(const std::vector<std::string>& parameters, User *user)
        {
                if (parameters[0].size() > ServerInstance->Config->Limits.IdentMax)
                {
-                       user->WriteServ("NOTICE %s :*** SETIDENT: Ident is too long", user->nick.c_str());
+                       user->WriteNotice("*** SETIDENT: Ident is too long");
                        return CMD_FAILURE;
                }
 
-               if (!ServerInstance->IsIdent(parameters[0].c_str()))
+               if (!ServerInstance->IsIdent(parameters[0]))
                {
-                       user->WriteServ("NOTICE %s :*** SETIDENT: Invalid characters in ident", user->nick.c_str());
+                       user->WriteNotice("*** SETIDENT: Invalid characters in ident");
                        return CMD_FAILURE;
                }
 
-               user->ChangeIdent(parameters[0].c_str());
+               user->ChangeIdent(parameters[0]);
                ServerInstance->SNO->WriteGlobalSno('a', "%s used SETIDENT to change their ident to '%s'", user->nick.c_str(), user->ident.c_str());
 
                return CMD_SUCCESS;
        }
 };
 
-
 class ModuleSetIdent : public Module
 {
        CommandSetident cmd;
@@ -67,21 +63,15 @@ class ModuleSetIdent : public Module
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
                ServerInstance->Modules->AddService(cmd);
        }
 
-       virtual ~ModuleSetIdent()
-       {
-       }
-
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the SETIDENT command", VF_VENDOR);
        }
-
 };
 
-
 MODULE_INIT(ModuleSetIdent)