diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-05 00:19:25 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-05 00:19:25 +0000 |
commit | dfa6568af2bceb842d6f9ba73ee6a6679e2c5d0c (patch) | |
tree | bb95d8125892b45acddfed0153a227fcc2b5555e /src/modules | |
parent | 15604f51eac55fb6cd22f66f3e265bbea0ae74cf (diff) |
Re-organized order of cmd_kick stuff (OnUserPreKick) to make override kicks work nicer
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3085 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_override.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index 3cce62758..a16f8428e 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -57,7 +57,7 @@ class ModuleOverride : public Module void Implements(char* List) { - List[I_OnRehash] = List[I_OnAccessCheck] = List[I_On005Numeric] = List[I_OnUserPreJoin] = 1; + List[I_OnRehash] = List[I_OnAccessCheck] = List[I_On005Numeric] = List[I_OnUserPreJoin] = List[I_OnUserPreKick] = 1; } virtual void On005Numeric(std::string &output) @@ -81,10 +81,24 @@ class ModuleOverride : public Module // its not defined at all, count as false return false; } + + virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason) + { + if ((*source->oper) && (CanOverride(source,"KICK"))) + { + if (((Srv->ChanMode(source,channel) == "%") && (Srv->ChanMode(user,channel) == "@")) || (Srv->ChanMode(source,channel) == "")) + { + Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Kicked "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")"); + } + /* Returning -1 explicitly allows the kick */ + return -1; + } + return 0; + } virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) { - if (strchr(source->modes,'o')) + if (*source->oper) { if ((Srv) && (source) && (channel)) { @@ -94,14 +108,6 @@ class ModuleOverride : public Module { switch (access_type) { - case AC_KICK: - if (CanOverride(source,"KICK")) - { - Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Kicked "+std::string(dest->nick)+" on "+std::string(channel->name)); - return ACR_ALLOW; - } - else return ACR_DEFAULT; - break; case AC_DEOP: if (CanOverride(source,"MODEDEOP")) { |