]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_setname.cpp
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
[user/henk/code/inspircd.git] / src / modules / m_setname.cpp
index de3131c7701152799ac8b200856968d528dd673a..d0dce6c77956d1202466098bf82d8a33215931dd 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
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Provides support for the SETNAME command */
 
 
 
-class cmd_setname : public command_t
+class CommandSetname : public Command
 {
  public:
-       cmd_setname (InspIRCd* Instance) : command_t(Instance,"SETNAME", 0, 1)
+       CommandSetname (InspIRCd* Instance) : Command(Instance,"SETNAME", 0, 1)
        {
                this->source = "m_setname.so";
                syntax = "<new-gecos>";
+               TRANSLATE2(TR_TEXT, TR_END);
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, User *user)
        {
                if (!*parameters[0])
                {
@@ -45,7 +43,7 @@ class cmd_setname : public command_t
                
                if (user->ChangeName(parameters[0]))
                {
-                       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, parameters[0]);
                        return CMD_SUCCESS;
                }
 
@@ -56,14 +54,15 @@ class cmd_setname : public command_t
 
 class ModuleSetName : public Module
 {
-       cmd_setname*    mycommand;
+       CommandSetname* mycommand;
  public:
        ModuleSetName(InspIRCd* Me)
                : Module(Me)
        {
                
-               mycommand = new cmd_setname(ServerInstance);
+               mycommand = new CommandSetname(ServerInstance);
                ServerInstance->AddCommand(mycommand);
+
        }
        
        virtual ~ModuleSetName()