]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_noctcp.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / m_noctcp.cpp
index b6044b3fecadd4ca2640d189b4832e7a23ddcc51..fb6e61c6e4729a8c9e697d239e0173b18715a066 100644 (file)
@@ -31,22 +31,19 @@ class NoCTCP : public SimpleChannelModeHandler
 
 class ModuleNoCTCP : public Module
 {
-
        NoCTCP nc;
 
  public:
-
        ModuleNoCTCP()
                : nc(this)
        {
-               if (!ServerInstance->Modes->AddMode(&nc))
-                       throw ModuleException("Could not add new modes!");
-               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 3);
        }
 
-       virtual ~ModuleNoCTCP()
+       void init()
        {
+               ServerInstance->Modules->AddService(nc);
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        virtual Version GetVersion()
@@ -80,9 +77,9 @@ class ModuleNoCTCP : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       virtual void On005Numeric(std::string &output)
+       virtual void On005Numeric(std::map<std::string, std::string>& tokens)
        {
-               ServerInstance->AddExtBanChar('C');
+               tokens["EXTBAN"].push_back('C');
        }
 };