]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgname.cpp
Always set the topic in Channel::SetTopic(), move access checks into cmd_topic
[user/henk/code/inspircd.git] / src / modules / m_chgname.cpp
index 3ce1da5ec6ca192de72355d129f1fe747c0856ef..5214478423360edc80f617c7b2f2fbeaffc600b0 100644 (file)
@@ -29,9 +29,10 @@ class CommandChgname : public Command
  public:
        CommandChgname(Module* Creator) : Command(Creator,"CHGNAME", 2, 2)
        {
+               allow_empty_last_param = false;
                flags_needed = 'o';
                syntax = "<nick> <newname>";
-               TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
+               TRANSLATE2(TR_NICK, TR_TEXT);
        }
 
        CmdResult Handle(const std::vector<std::string> &parameters, User *user)
@@ -46,13 +47,13 @@ class CommandChgname : public Command
 
                if (parameters[1].empty())
                {
-                       user->WriteServ("NOTICE %s :*** CHGNAME: GECOS must be specified", user->nick.c_str());
+                       user->WriteNotice("*** CHGNAME: GECOS must be specified");
                        return CMD_FAILURE;
                }
 
                if (parameters[1].length() > ServerInstance->Config->Limits.MaxGecos)
                {
-                       user->WriteServ("NOTICE %s :*** CHGNAME: GECOS too long", user->nick.c_str());
+                       user->WriteNotice("*** CHGNAME: GECOS too long");
                        return CMD_FAILURE;
                }
 
@@ -74,7 +75,6 @@ class CommandChgname : public Command
        }
 };
 
-
 class ModuleChgName : public Module
 {
        CommandChgname cmd;
@@ -84,16 +84,12 @@ public:
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
                ServerInstance->Modules->AddService(cmd);
        }
 
-       virtual ~ModuleChgName()
-       {
-       }
-
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for the CHGNAME command", VF_OPTCOMMON | VF_VENDOR);
        }