X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_channelban.cpp;h=4d3f80e361d035cc155da3f7c9c7b8d47869ad37;hb=3ccf0065d43db80f31c6404aeac4d65551481508;hp=1987a982eb53099d5ab9bdc961126e17873d91d7;hpb=4b41feea830fc84e8c1b2fd0982f3e8d8840af96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_channelban.cpp b/src/modules/m_channelban.cpp index 1987a982e..4d3f80e36 100644 --- a/src/modules/m_channelban.cpp +++ b/src/modules/m_channelban.cpp @@ -20,17 +20,9 @@ #include "inspircd.h" -/* $ModDesc: Implements extban +b j: - matching channel bans */ - class ModuleBadChannelExtban : public Module { public: - void init() CXX11_OVERRIDE - { - Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Extban 'j' - channel status/join ban", VF_OPTCOMMON|VF_VENDOR); @@ -48,17 +40,11 @@ class ModuleBadChannelExtban : public Module rm = mask.substr(3); status = mh->GetModeChar(); } - for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++) + for (User::ChanList::iterator i = user->chans.begin(); i != user->chans.end(); i++) { - if (InspIRCd::Match((**i).name, rm)) + if (InspIRCd::Match((*i)->chan->name, rm)) { - if (status) - { - Membership* memb = (**i).GetUser(user); - if (memb && memb->hasMode(status)) - return MOD_RES_DENY; - } - else + if (!status || (*i)->hasMode(status)) return MOD_RES_DENY; } }