X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanfilter.cpp;h=5bb5a91b03a59cc72c3fc7ca2ef3d076a988005b;hb=de69e28a4a1aea89e410b693bbbb67890ecb0bd3;hp=b517d363e5bea15b21b9e03c1caab6d8e7288eac;hpb=9336468f5bfa60318cb57db5126047147b7a21cb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index b517d363e..5bb5a91b0 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -18,14 +18,13 @@ #include "u_listmode.h" /* $ModDesc: Provides channel-specific censor lists (like mode +G but varies from channel to channel) */ -/* $ModDep: ../../include/u_listmode.h */ /** Handles channel mode +g */ class ChanFilter : public ListModeBase { public: - ChanFilter(Module* Creator) : ListModeBase(Creator, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { } + ChanFilter(Module* Creator) : ListModeBase(Creator, "filter", 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { } virtual bool ValidateParam(User* user, Channel* chan, std::string &word) { @@ -69,11 +68,10 @@ class ModuleChanFilter : public Module throw ModuleException("Could not add new modes!"); cf.DoImplements(this); - Implementation eventlist[] = { I_OnCleanup, I_OnChannelDelete, I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice, I_OnSyncChannel }; - ServerInstance->Modules->Attach(eventlist, this, 6); + Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice, I_OnSyncChannel }; + ServerInstance->Modules->Attach(eventlist, this, 4); OnRehash(NULL); - ServerInstance->Modules->PublishInterface("ChannelBanList", this); } virtual void OnRehash(User* user) @@ -85,7 +83,10 @@ class ModuleChanFilter : public Module virtual ModResult ProcessMessages(User* user,Channel* chan,std::string &text) { - if (!IS_LOCAL(user) || (CHANOPS_EXEMPT('g') && chan->GetPrefixValue(user) == OP_VALUE)) + ModResult res; + FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,chan,"filter")); + + if (!IS_LOCAL(user) || res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; modelist* list = cf.extItem.get(chan); @@ -122,11 +123,6 @@ class ModuleChanFilter : public Module cf.DoCleanup(target_type, item); } - virtual const char* OnRequest(Request* request) - { - return cf.DoOnRequest(request); - } - virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) { return OnUserPreMessage(user,dest,target_type,text,status,exempt_list); @@ -139,12 +135,11 @@ class ModuleChanFilter : public Module virtual Version GetVersion() { - return Version("Provides channel-specific censor lists (like mode +G but varies from channel to channel)", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Provides channel-specific censor lists (like mode +G but varies from channel to channel)", VF_COMMON | VF_VENDOR); } virtual ~ModuleChanFilter() { - ServerInstance->Modules->UnpublishInterface("ChannelBanList", this); } };