]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_inviteexception.cpp
Move the <disabled> tag out of the core to a new module.
[user/henk/code/inspircd.git] / src / modules / m_inviteexception.cpp
index 9eaa5be73c1be59ef041dde9bae1732a8ee96e87..3f9459d1918cbaf86cf1c48d24fbedf17c1a234f 100644 (file)
 class InviteException : public ListModeBase
 {
  public:
-       InviteException(Module* Creator) : ListModeBase(Creator, "invex", 'I', "End of Channel Invite Exception List", 346, 347, true) { }
+       InviteException(Module* Creator)
+               : ListModeBase(Creator, "invex", 'I', "End of Channel Invite Exception List", 346, 347, true)
+       {
+       }
 };
 
 class ModuleInviteException : public Module
@@ -51,19 +54,9 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(ie);
-
-               OnRehash(NULL);
-               ie.DoImplements(this);
-               Implementation eventlist[] = { I_On005Numeric, I_OnCheckInvite, I_OnCheckKey, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-       }
-
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
-               tokens["INVEX"] = "I";
+               tokens["INVEX"] = ConvToStr(ie.GetModeChar());
        }
 
        ModResult OnCheckInvite(User* user, Channel* chan) CXX11_OVERRIDE
@@ -90,15 +83,10 @@ public:
                return MOD_RES_PASSTHRU;
        }
 
-       void OnSyncChannel(Channel* chan, Module* proto, void* opaque) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
-               ie.DoSyncChannel(chan, proto, opaque);
-       }
-
-       void OnRehash(User* user) CXX11_OVERRIDE
-       {
-               invite_bypass_key = ServerInstance->Config->ConfValue("inviteexception")->getBool("bypasskey", true);
                ie.DoRehash();
+               invite_bypass_key = ServerInstance->Config->ConfValue("inviteexception")->getBool("bypasskey", true);
        }
 
        Version GetVersion() CXX11_OVERRIDE