]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_vhost.cpp
Fix crash on propogation after routed squit has reached it's destination. Thx HiroP.
[user/henk/code/inspircd.git] / src / modules / m_vhost.cpp
index eb6c3e38e151c276d0fc74aac63b52d40e810370..82286748863fa716c572865986e873083a9e0583 100644 (file)
@@ -2,35 +2,30 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#include <stdio.h>
+#include "inspircd.h"
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "inspircd.h"
 
 /* $ModDesc: Provides masking of user hostnames via traditional /VHOST command */
 
-static ConfigReader *Conf;
-
+static ConfigReader* Conf;
 
+/** Handle /VHOST
+ */
 class cmd_vhost : public command_t
 {
  public:
- cmd_vhost (InspIRCd* Instance) : command_t(Instance,"VHOST", 0, 2)
      cmd_vhost (InspIRCd* Instance) : command_t(Instance,"VHOST", 0, 2)
        {
                this->source = "m_vhost.so";
                syntax = "<username> <password>";
@@ -45,7 +40,7 @@ class cmd_vhost : public command_t
                        std::string pass = Conf->ReadValue("vhost","pass",index);
                        if ((!strcmp(parameters[0],username.c_str())) && (!strcmp(parameters[1],pass.c_str())))
                        {
-                               if (mask != "")
+                               if (!mask.empty())
                                {
                                        user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
                                        user->ChangeDisplayedHost(mask.c_str());
@@ -65,7 +60,7 @@ class ModuleVHost : public Module
        cmd_vhost* mycommand;
         
  public:
-       ModuleVHost(InspIRCd* Me) : Module::Module(Me)
+       ModuleVHost(InspIRCd* Me) : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
@@ -83,7 +78,7 @@ class ModuleVHost : public Module
                List[I_OnRehash] = 1;
        }
 
-       virtual void OnRehash(const std::string &parameter)
+       virtual void OnRehash(userrec* user, const std::string &parameter)
        {
                DELETE(Conf);
                Conf = new ConfigReader(ServerInstance);
@@ -91,9 +86,7 @@ class ModuleVHost : public Module
        
        virtual Version GetVersion()
        {
-               // returns the version number of the module to be
-               // listed in /MODULES
-               return Version(1,0,0,1,VF_VENDOR);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
        
 };
@@ -119,7 +112,7 @@ class ModuleVHostFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleVHostFactory;
 }