]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgident.cpp
Add initial query support to m_mysql [patch by Athenon]
[user/henk/code/inspircd.git] / src / modules / m_chgident.cpp
index 4943e3df81afd0b0413589985d6673157bd0acb2..58a06cbd8366104ed05439dc9b43e2d4ead3bdd8 100644 (file)
@@ -20,9 +20,8 @@
 class CommandChgident : public Command
 {
  public:
-       CommandChgident (InspIRCd* Instance) : Command(Instance,"CHGIDENT", "o", 2)
+       CommandChgident (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CHGIDENT", "o", 2)
        {
-               this->source = "m_chgident.so";
                syntax = "<nick> <newident>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -58,7 +57,7 @@ class CommandChgident : public Command
                dest->ChangeIdent(parameters[1].c_str());
 
                if (!ServerInstance->ULine(user->server))
-                       ServerInstance->SNO->WriteToSnoMask('a', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str());
+                       ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(dest) ? 'a' : 'A', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str());
 
                /* route it! */
                return CMD_SUCCESS;
@@ -68,15 +67,12 @@ class CommandChgident : public Command
 
 class ModuleChgIdent : public Module
 {
-       CommandChgident* mycommand;
-
+       CommandChgident cmd;
 
 public:
-       ModuleChgIdent(InspIRCd* Me) : Module(Me)
+       ModuleChgIdent(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
-               mycommand = new CommandChgident(ServerInstance);
-               ServerInstance->AddCommand(mycommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
        virtual ~ModuleChgIdent()