]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_setname.cpp
Make irc::sockets::* parameters consistent, add irc::sockets::mask
[user/henk/code/inspircd.git] / src / modules / m_setname.cpp
index 4398ab12339d90121aff9df15919e935e4cfffb5..bfb8f116f8d5d5bdbbacffe6d6af15d03d05c7ca 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -20,9 +20,8 @@
 class CommandSetname : public Command
 {
  public:
-       CommandSetname (InspIRCd* Instance) : Command(Instance,"SETNAME", 0, 1, 1)
+       CommandSetname(Module* Creator) : Command(Creator,"SETNAME", 1, 1)
        {
-               this->source = "m_setname.so";
                syntax = "<new-gecos>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -43,7 +42,7 @@ class CommandSetname : public Command
 
                if (user->ChangeName(parameters[0].c_str()))
                {
-                       ServerInstance->SNO->WriteToSnoMask('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;
                }
 
@@ -54,15 +53,12 @@ class CommandSetname : public Command
 
 class ModuleSetName : public Module
 {
-       CommandSetname* mycommand;
+       CommandSetname cmd;
  public:
-       ModuleSetName(InspIRCd* Me)
-               : Module(Me)
+       ModuleSetName()
+               : cmd(this)
        {
-
-               mycommand = new CommandSetname(ServerInstance);
-               ServerInstance->AddCommand(mycommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
        virtual ~ModuleSetName()
@@ -71,9 +67,8 @@ class ModuleSetName : public Module
 
        virtual Version GetVersion()
        {
-               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("Provides support for the SETNAME command", VF_VENDOR);
        }
-
 };
 
 MODULE_INIT(ModuleSetName)