]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_invisible.cpp
Fix these to use new hook system (u_listmode wasnt fixed yet)
[user/henk/code/inspircd.git] / src / modules / m_invisible.cpp
index 2ec8439cf7d89483a43bfa2677c5b7db384f560f..2986f43c6497c99c89d082429492f302566a0ddf 100644 (file)
@@ -159,7 +159,7 @@ class ModuleInvisible : public Module
        {
                conf = new ConfigReader(ServerInstance);
                qm = new InvisibleMode(ServerInstance);
-               if (!ServerInstance->AddMode(qm, 'Q'))
+               if (!ServerInstance->AddMode(qm))
                        throw ModuleException("Could not add new modes!");
                ido = new InvisibleDeOper(ServerInstance);
                if (!ServerInstance->AddModeWatcher(ido))
@@ -167,15 +167,17 @@ class ModuleInvisible : public Module
 
                /* Yeah i know people can take this out. I'm not about to obfuscate code just to be a pain in the ass. */
                ServerInstance->ServerNoticeAll("*** m_invisible.so has just been loaded on this network. For more information, please visit http://inspircd.org/wiki/Modules/invisible");
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserJoin, I_OnUserPart, I_OnUserQuit, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 6);
        }
 
        virtual ~ModuleInvisible()
        {
                ServerInstance->Modes->DelMode(qm);
                ServerInstance->Modes->DelModeWatcher(ido);
-               DELETE(qm);
-               DELETE(ido);
-               DELETE(conf);
+               delete qm;
+               delete ido;
+               delete conf;
        }
 
        virtual Version GetVersion()
@@ -201,7 +203,7 @@ class ModuleInvisible : public Module
 
        virtual void OnRehash(User* user, const std::string &parameter)
        {
-               DELETE(conf);
+               delete conf;
                conf = new ConfigReader(ServerInstance);
        }