]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgname.cpp
Register a few extensions that weren't registered
[user/henk/code/inspircd.git] / src / modules / m_chgname.cpp
index 194ecf80eacb375007f5a6451e673c743ee7ef21..aadf29fdb4532b54fe82aebda8d0b4b427e7b127 100644 (file)
@@ -44,16 +44,22 @@ class CommandChgname : public Command
                        return CMD_FAILURE;
                }
 
+               if (parameters[1].empty())
+               {
+                       user->WriteServ("NOTICE %s :*** CHGNAME: GECOS must be specified", user->nick.c_str());
+                       return CMD_FAILURE;
+               }
+
                if (parameters[1].length() > ServerInstance->Config->Limits.MaxGecos)
                {
-                       user->WriteServ("NOTICE %s :*** GECOS too long", user->nick.c_str());
+                       user->WriteServ("NOTICE %s :*** CHGNAME: GECOS too long", user->nick.c_str());
                        return CMD_FAILURE;
                }
 
                if (IS_LOCAL(dest))
                {
                        dest->ChangeName(parameters[1].c_str());
-                       ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGNAME to change %s's real name to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->fullname.c_str());
+                       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());
                }
 
                return CMD_SUCCESS;
@@ -76,7 +82,11 @@ class ModuleChgName : public Module
 public:
        ModuleChgName() : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual ~ModuleChgName()