]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockcaps.cpp
Argh, i give up
[user/henk/code/inspircd.git] / src / modules / m_blockcaps.cpp
index 167a12bec07722eab197892a9a9438cccda94772..44ad7e8916bca76d8c87b365ec56b0fad17b7871 100644 (file)
@@ -58,14 +58,15 @@ public:
        {
                OnRehash(NULL,"");
                bc = new BlockCaps(ServerInstance);
-               if (!ServerInstance->AddMode(bc, 'P'))
+               if (!ServerInstance->AddMode(bc))
+               {
+                       delete bc;
                        throw ModuleException("Could not add new modes!");
+               }
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 3);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnRehash] = 1;
-       }
 
        virtual void OnRehash(User* user, const std::string &param)
        {
@@ -127,7 +128,7 @@ public:
        virtual ~ModuleBlockCAPS()
        {
                ServerInstance->Modes->DelMode(bc);
-               DELETE(bc);
+               delete bc;
        }
 
        virtual Version GetVersion()