diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-05-01 12:44:07 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-05-01 12:44:07 +0000 |
commit | 8e475017a6f87ac936993fa9791a6634683dd512 (patch) | |
tree | d7d22134e17c5171e10e75605ddae849faf06c92 /src/inspircd.cpp | |
parent | e53c7aa50c815761f84e0ba3a28c0e6e58dc025f (diff) |
Added Module::OnAccessCheck
Added ListMode support
Fixed Extensible class bug
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@759 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index f313c64c7..310ef4043 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1310,6 +1310,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri if (!FindChan(cname)) { + int MOD_RESULT = 0; FOREACH_RESULT(OnUserPreJoin(user,NULL,cname)); if (MOD_RESULT) { return NULL; @@ -1347,6 +1348,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri // and bans (used by servers) if (!override) { + int MOD_RESULT = 0; FOREACH_RESULT(OnUserPreJoin(user,Ptr,cname)); if (MOD_RESULT) { return NULL; @@ -1600,18 +1602,28 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) WriteServ(src->fd,"441 %s %s %s :They are not on that channel",src->nick, user->nick, Ptr->name); return; } - if (((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) && (!is_uline(src->server))) + + int MOD_RESULT = 0; + FOREACH_RESULT(OnAccessCheck(src,user,Ptr,AC_KICK)); + + if (MOD_RESULT == ACR_DENY) + return; + + if (MOD_RESULT == ACR_DEFAULT) { - if (cstatus(src,Ptr) == STATUS_HOP) - { - WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name); - } - else + if (((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) && (!is_uline(src->server))) { - 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 (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; } - - return; } for (int i =0; i != MAXCHANS; i++) |