From 2d732f4dbf4ccd22c8a4424692cc72a89ffd49b7 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 13 Sep 2009 20:33:11 +0000 Subject: Change match direction of extbans to allow stacking This allows you create stacked bans like: +b m:r:*bot* to mute anyone with bot in their gecos +e S:j:+#staff to allow voices in #staff to use color It also deprecates extban M, which can be implemented using m:R: git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11711 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_operchans.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/modules/m_operchans.cpp') diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index d97142e66..32d54bce7 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -46,7 +46,6 @@ class OperChans : public ModeHandler class ModuleOperChans : public Module { - OperChans oc; public: ModuleOperChans(InspIRCd* Me) @@ -54,11 +53,10 @@ class ModuleOperChans : public Module { if (!ServerInstance->Modes->AddMode(&oc)) throw ModuleException("Could not add new modes!"); - Implementation eventlist[] = { I_OnCheckBan, I_OnUserPreJoin }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(I_OnUserPreJoin, this); } - virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven) + ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven) { if (chan && chan->IsModeSet('O') && !IS_OPER(user)) { @@ -69,20 +67,12 @@ class ModuleOperChans : public Module return MOD_RES_PASSTHRU; } - virtual ModResult OnCheckBan(User* user, Channel* chan) - { - if (IS_OPER(user)) - return chan->GetExtBanStatus(user->oper, 'O'); - - return MOD_RES_PASSTHRU; - } - - virtual ~ModuleOperChans() + ~ModuleOperChans() { ServerInstance->Modes->DelMode(&oc); } - virtual Version GetVersion() + Version GetVersion() { return Version("$Id$", VF_VENDOR | VF_COMMON, API_VERSION); } -- cgit v1.3.1-10-gc9f91