]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_allowinvite.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / m_allowinvite.cpp
index 19a8640e794befcc46fa21ec463802958d798acf..9cc8261b81f5c00d5b6f25c3a9b6adb63fdada3f 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides support for channel mode +A, allowing /invite freely on a channel (and extban A to allow specific users it) */
+/* $ModDesc: Provides support for channel mode +A, allowing /invite freely on a channel and extban A to deny specific users it */
 
 class AllowInvite : public SimpleChannelModeHandler
 {
@@ -34,15 +34,18 @@ class ModuleAllowInvite : public Module
 
        ModuleAllowInvite() : ni(this)
        {
-               if (!ServerInstance->Modes->AddMode(&ni))
-                       throw ModuleException("Could not add new modes!");
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(ni);
                Implementation eventlist[] = { I_OnUserPreInvite, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
-       virtual void On005Numeric(std::string &output)
+       virtual void On005Numeric(std::map<std::string, std::string>& tokens)
        {
-               ServerInstance->AddExtBanChar('A');
+               tokens["EXTBAN"].push_back('A');
        }
 
        virtual ModResult OnUserPreInvite(User* user,User* dest,Channel* channel, time_t timeout)
@@ -66,13 +69,9 @@ class ModuleAllowInvite : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       virtual ~ModuleAllowInvite()
-       {
-       }
-
        virtual Version GetVersion()
        {
-               return Version("Provides support for channel mode +A, allowing /invite freely on a channel (and extban A to allow specific users it)",VF_VENDOR);
+               return Version("Provides support for channel mode +A, allowing /invite freely on a channel and extban A to deny specific users it",VF_VENDOR);
        }
 };