]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_setname.cpp
Move all the parameters around AGAIN. See docs shortly
[user/henk/code/inspircd.git] / src / modules / m_setname.cpp
index b15d52252d7afba5ef1eb87a8c5b8edb48a9cc07..1e8bceb8a3e27cc2d14584a779df6cb117bcf11a 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -27,23 +27,23 @@ class CommandSetname : public Command
                TRANSLATE2(TR_TEXT, TR_END);
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, User *user)
+       CmdResult Handle (const std::vector<std::string>& parameters, User *user)
        {
-               if (!*parameters[0])
+               if (parameters.size() == 0)
                {
-                       user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick);
+                       user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick.c_str());
                        return CMD_FAILURE;
                }
-               
-               if (strlen(parameters[0]) > MAXGECOS)
+
+               if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos)
                {
-                       user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick);
+                       user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick.c_str());
                        return CMD_FAILURE;
                }
-               
-               if (user->ChangeName(parameters[0]))
+
+               if (user->ChangeName(parameters[0].c_str()))
                {
-                       ServerInstance->WriteOpers("%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]);
+                       ServerInstance->SNO->WriteToSnoMask('A', "%s used SETNAME to change their GECOS to %s", user->nick.c_str(), parameters[0].c_str());
                        return CMD_SUCCESS;
                }
 
@@ -59,21 +59,21 @@ class ModuleSetName : public Module
        ModuleSetName(InspIRCd* Me)
                : Module(Me)
        {
-               
+
                mycommand = new CommandSetname(ServerInstance);
                ServerInstance->AddCommand(mycommand);
 
        }
-       
+
        virtual ~ModuleSetName()
        {
        }
-       
+
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
        }
-       
+
 };
 
 MODULE_INIT(ModuleSetName)