]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_noctcp.cpp
Merge insp20
[user/henk/code/inspircd.git] / src / modules / m_noctcp.cpp
index 144ac312b145641bdf1f1413fc46b4ab47b63f63..fb6e61c6e4729a8c9e697d239e0173b18715a066 100644 (file)
@@ -31,11 +31,9 @@ class NoCTCP : public SimpleChannelModeHandler
 
 class ModuleNoCTCP : public Module
 {
-
        NoCTCP nc;
 
  public:
-
        ModuleNoCTCP()
                : nc(this)
        {
@@ -43,14 +41,9 @@ class ModuleNoCTCP : public Module
 
        void init()
        {
-               if (!ServerInstance->Modes->AddMode(&nc))
-                       throw ModuleException("Could not add new modes!");
+               ServerInstance->Modules->AddService(nc);
                Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 3);
-       }
-
-       virtual ~ModuleNoCTCP()
-       {
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        virtual Version GetVersion()
@@ -84,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');
        }
 };