]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cloaking.cpp
Remove some debug (im on a crusade to make debug mode useful, but at the same time...
[user/henk/code/inspircd.git] / src / modules / m_cloaking.cpp
index ffa1890076aebc6932705e123a19400bc1c648ba..707085b144cd9afa0db06a72e5e7befd51352fd5 100644 (file)
@@ -2,12 +2,9 @@
  *       | 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.
  *
@@ -230,7 +227,9 @@ class ModuleCloaking : public Module
        ModuleCloaking(InspIRCd* Me)
                : Module::Module(Me)
        {
-               /* Attempt to locate the Hash service provider, bail if we can't find it */
+               ServerInstance->UseInterface("HashRequest");
+
+               /* Attempt to locate the md5 service provider, bail if we can't find it */
                HashModule = ServerInstance->FindModule("m_md5.so");
                if (!HashModule)
                        throw ModuleException("Can't find m_md5.so. Please load m_md5.so before m_cloaking.so.");
@@ -239,15 +238,17 @@ class ModuleCloaking : public Module
                cu = new CloakUser(ServerInstance, this, HashModule);
 
                /* Register it with the core */         
-               ServerInstance->AddMode(cu, 'x');
+               if (!ServerInstance->AddMode(cu, 'x'))
+                       throw ModuleException("Could not add new modes!");
 
-               OnRehash("");
+               OnRehash(NULL,"");
        }
        
        virtual ~ModuleCloaking()
        {
                ServerInstance->Modes->DelMode(cu);
                DELETE(cu);
+               ServerInstance->DoneWithInterface("HashRequest");
        }
        
        virtual Version GetVersion()
@@ -257,7 +258,7 @@ class ModuleCloaking : public Module
                return Version(1,1,0,2,VF_COMMON|VF_VENDOR,API_VERSION);
        }
 
-       virtual void OnRehash(const std::string &parameter)
+       virtual void OnRehash(userrec* user, const std::string &parameter)
        {
                cu->DoRehash();
        }