]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chgname.cpp
Add initial query support to m_mysql [patch by Athenon]
[user/henk/code/inspircd.git] / src / modules / m_chgname.cpp
index c05499039a90385560aedffac4fa3242524b3bea..23c870294cf00153cc8e589ce2c662289530c3d6 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 CommandChgname : public Command
 {
  public:
-       CommandChgname (InspIRCd* Instance) : Command(Instance,"CHGNAME", "o", 2, 2)
+       CommandChgname (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CHGNAME", "o", 2, 2)
        {
-               this->source = "m_chgname.so";
                syntax = "<nick> <newname>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -52,8 +51,7 @@ class CommandChgname : public Command
                if (IS_LOCAL(dest))
                {
                        dest->ChangeName(parameters[1].c_str());
-                       ServerInstance->SNO->WriteToSnoMask('A', "%s used CHGNAME to change %s's real name to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->fullname.c_str());
-                       return CMD_LOCALONLY; /* name change routed by FNAME in spanningtree now */
+                       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());
                }
 
                /* route it! */
@@ -64,15 +62,12 @@ class CommandChgname : public Command
 
 class ModuleChgName : public Module
 {
-       CommandChgname* mycommand;
-
+       CommandChgname cmd;
 
 public:
-       ModuleChgName(InspIRCd* Me) : Module(Me)
+       ModuleChgName(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
-               mycommand = new CommandChgname(ServerInstance);
-               ServerInstance->AddCommand(mycommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
        virtual ~ModuleChgName()