summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-30 17:52:06 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-30 17:52:06 +0000
commit18f24e05d3730ba945c3c16d383149e0863ce743 (patch)
tree02733fcba225a66b6c035c33842f4488788b3ce8 /src
parent6a869d0701bbfe3c7a5e370793adfda4b5b45c65 (diff)
Add extban +b O: for opertype banning.. mostly useful for +be to create a channel with only one level of opertype permitted. Thanks partly to Kein.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10077 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_operchans.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index 3b28eeb38..7bc132515 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -63,17 +63,32 @@ class ModuleOperChans : public Module
virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
{
+ bool banned = false;
+
if (!IS_OPER(user))
{
if (chan)
{
if (chan->IsModeSet('O'))
{
- user->WriteNumeric(ERR_CANTJOINOPERSONLY, "%s %s :Only IRC operators may join the channel %s (+O is set)",user->nick.c_str(), chan->name.c_str(), chan->name.c_str());
- return 1;
+ banned = true;
}
}
}
+ else
+ {
+ if (chan && chan->IsExtBanned(user->oper, 'O'))
+ {
+ banned = true;
+ }
+ }
+
+ if (banned)
+ {
+ user->WriteNumeric(ERR_CANTJOINOPERSONLY, "%s %s :Only IRC operators may join the channel %s (+O is set)",user->nick.c_str(), chan->name.c_str(), chan->name.c_str());
+ return 1;
+ }
+
return 0;
}