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/channels.cpp | |
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/channels.cpp')
-rw-r--r-- | src/channels.cpp | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index e8e7efcf8..4c6634a16 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -589,33 +589,38 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) return; } int MOD_RESULT = 0; - FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,Ptr,AC_KICK)); - if ((MOD_RESULT == ACR_DENY) && (!is_uline(src->server))) - return; - - if ((MOD_RESULT == ACR_DEFAULT) || (!is_uline(src->server))) - { - if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) - { - if (cstatus(src,Ptr) == STATUS_HOP) - { - WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name); - } - else - { - WriteServ(src->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",src->nick, Ptr->name); - } + + if (!is_uline(src->server)) + { + MOD_RESULT = 0; + FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,Ptr,reason)); + if (MOD_RESULT == 1) + return; + } + /* Set to -1 by OnUserPreKick if explicit allow was set */ + if (MOD_RESULT != -1) + { + FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,Ptr,AC_KICK)); + if ((MOD_RESULT == ACR_DENY) && (!is_uline(src->server))) + return; - return; - } - } - if (!is_uline(src->server)) - { - MOD_RESULT = 0; - FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,Ptr,reason)); - if (MOD_RESULT) - return; - } + if ((MOD_RESULT == ACR_DEFAULT) || (!is_uline(src->server))) + { + if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) + { + if (cstatus(src,Ptr) == STATUS_HOP) + { + WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name); + } + else + { + WriteServ(src->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",src->nick, Ptr->name); + } + + return; + } + } + } } FOREACH_MOD(I_OnUserKick,OnUserKick(src,user,Ptr,reason)); |