]> 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 233def0b6de359cacd298a6df9eebee0c946e1cb..82286748863fa716c572865986e873083a9e0583 100644 (file)
@@ -2,25 +2,19 @@
  *       | 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 */
 
@@ -46,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());
@@ -66,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);
@@ -84,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);
@@ -92,7 +86,7 @@ class ModuleVHost : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_VENDOR,API_VERSION);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
        
 };
@@ -118,7 +112,7 @@ class ModuleVHostFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleVHostFactory;
 }