X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_inviteexception.cpp;h=3f9459d1918cbaf86cf1c48d24fbedf17c1a234f;hb=d4a1ea70451abb333e71f9cff09b624db59531a0;hp=aa5da086bd1ac9906ed122e476cb4e15b230d003;hpb=ebe5b201aab71cf2ead1e068889be736314fbb73;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp index aa5da086b..3f9459d19 100644 --- a/src/modules/m_inviteexception.cpp +++ b/src/modules/m_inviteexception.cpp @@ -24,9 +24,6 @@ #include "inspircd.h" #include "listmode.h" -/* $ModDesc: Provides support for the +I channel mode */ -/* $ModDep: ../../include/listmode.h */ - /* * Written by Om , April 2005. * Based on m_exception, which was originally based on m_chanprotect and m_silence @@ -42,7 +39,10 @@ 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 @@ -54,22 +54,12 @@ public: { } - void init() - { - 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::string &output) + void On005Numeric(std::map& tokens) CXX11_OVERRIDE { - output.append(" INVEX=I"); + tokens["INVEX"] = ConvToStr(ie.GetModeChar()); } - ModResult OnCheckInvite(User* user, Channel* chan) + ModResult OnCheckInvite(User* user, Channel* chan) CXX11_OVERRIDE { ListModeBase::ModeList* list = ie.GetList(chan); if (list) @@ -86,25 +76,20 @@ public: return MOD_RES_PASSTHRU; } - ModResult OnCheckKey(User* user, Channel* chan, const std::string& key) + ModResult OnCheckKey(User* user, Channel* chan, const std::string& key) CXX11_OVERRIDE { if (invite_bypass_key) return OnCheckInvite(user, chan); return MOD_RES_PASSTHRU; } - void OnSyncChannel(Channel* chan, Module* proto, void* opaque) - { - ie.DoSyncChannel(chan, proto, opaque); - } - - void OnRehash(User* user) + void ReadConfig(ConfigStatus& status) 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() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for the +I channel mode", VF_VENDOR); }