]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_vhost.cpp
Replace OnAccessCheck with OnPreMode to remove a number of redundant checks
[user/henk/code/inspircd.git] / src / modules / m_vhost.cpp
index f5ee54f6cc05980011828a0058038bbe5ee74939..6c630622cd895a9ce25a8588dae01474f8d3eba6 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 CommandVhost : public Command
 {
  public:
-       CommandVhost (InspIRCd* Instance) : Command(Instance,"VHOST", 0, 2)
+       CommandVhost (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"VHOST", 0, 2)
        {
-               this->source = "m_vhost.so";
                syntax = "<username> <password>";
        }
 
@@ -44,7 +43,7 @@ class CommandVhost : public Command
                                        user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
                                        user->ChangeDisplayedHost(mask.c_str());
                                        delete Conf;
-                                       return CMD_LOCALONLY;
+                                       return CMD_SUCCESS;
                                }
                        }
                }
@@ -58,15 +57,12 @@ class CommandVhost : public Command
 class ModuleVHost : public Module
 {
  private:
-
-       CommandVhost* mycommand;
+       CommandVhost cmd;
 
  public:
-       ModuleVHost(InspIRCd* Me) : Module(Me)
+       ModuleVHost(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
-               mycommand = new CommandVhost(ServerInstance);
-               ServerInstance->AddCommand(mycommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
        virtual ~ModuleVHost()