]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_vhost.cpp
Get rid of a bunch of memory-wasting C-style strings
[user/henk/code/inspircd.git] / src / modules / m_vhost.cpp
index 419b51c9b7a6f2c7565d0f8728196df136696cd4..f1a074aec8aeb79f569c65c916658ba8547e3d57 100644 (file)
 class CommandVhost : public Command
 {
  public:
-       CommandVhost (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"VHOST", 0, 2)
+       CommandVhost(Module* Creator) : Command(Creator,"VHOST", 2)
        {
                syntax = "<username> <password>";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
-               ConfigReader *Conf = new ConfigReader(ServerInstance);
+               ConfigReader *Conf = new ConfigReader;
 
                for (int index = 0; index < Conf->Enumerate("vhost"); index++)
                {
@@ -43,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;
                                }
                        }
                }
@@ -60,7 +60,7 @@ class ModuleVHost : public Module
        CommandVhost cmd;
 
  public:
-       ModuleVHost(InspIRCd* Me) : Module(Me), cmd(Me, this)
+       ModuleVHost() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
@@ -72,7 +72,7 @@ class ModuleVHost : public Module
 
        virtual Version GetVersion()
        {
-               return Version("$Id$",VF_VENDOR,API_VERSION);
+               return Version("Provides masking of user hostnames via traditional /VHOST command",VF_VENDOR,API_VERSION);
        }
 
 };