X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_denychans.cpp;h=237447ac7dfd915a4a2aca69e14f48bcb0e2f0de;hb=67de413cad88194972d55a8ff88464370890c5a9;hp=b09ee7977d24d65a199db45debaef82bc988be7a;hpb=d9d99cd02dadf34bfcc220734ba0c422f0acb3e6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp index b09ee7977..237447ac7 100644 --- a/src/modules/m_denychans.cpp +++ b/src/modules/m_denychans.cpp @@ -22,15 +22,14 @@ #include "inspircd.h" -/* $ModDesc: Implements config tags which allow blocking of joins to channels */ - class ModuleDenyChannels : public Module { + ChanModeReference redirectmode; + public: - void init() CXX11_OVERRIDE + ModuleDenyChannels() + : redirectmode(this, "redirect") { - Implementation eventlist[] = { I_OnUserPreJoin, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } void OnRehash(User* user) CXX11_OVERRIDE @@ -112,7 +111,7 @@ class ModuleDenyChannels : public Module { /* simple way to avoid potential loops: don't redirect to +L channels */ Channel *newchan = ServerInstance->FindChan(redirect); - if ((!newchan) || (!(newchan->IsModeSet('L')))) + if ((!newchan) || (!newchan->IsModeSet(redirectmode))) { user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),redirect.c_str(), reason.c_str()); Channel::JoinUser(user, redirect);