]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_setname.cpp
ISupportManager: Tidy-up, expand comments
[user/henk/code/inspircd.git] / src / modules / m_setname.cpp
index 3b8d4d149006d72f50d25b561fe4fb615b9a6867..ee42d38520f4bd54319c24778bd396d0f9aeee04 100644 (file)
@@ -30,27 +30,22 @@ class CommandSetname : public Command
  public:
        CommandSetname(Module* Creator) : Command(Creator,"SETNAME", 1, 1)
        {
+               allow_empty_last_param = false;
                syntax = "<new-gecos>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
        {
-               if (parameters[0].empty())
-               {
-                       user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick.c_str());
-                       return CMD_FAILURE;
-               }
-
                if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos)
                {
-                       user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick.c_str());
+                       user->WriteNotice("*** SETNAME: GECOS too long");
                        return CMD_FAILURE;
                }
 
                if (user->ChangeName(parameters[0].c_str()))
                {
-                       ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to %s", user->nick.c_str(), parameters[0].c_str());
+                       ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to '%s'", user->nick.c_str(), parameters[0].c_str());
                }
 
                return CMD_SUCCESS;
@@ -65,14 +60,14 @@ class ModuleSetName : public Module
        ModuleSetName()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
        }
 
-       virtual ~ModuleSetName()
+       void init() CXX11_OVERRIDE
        {
+               ServerInstance->Modules->AddService(cmd);
        }
 
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the SETNAME command", VF_VENDOR);
        }