From 18f24e05d3730ba945c3c16d383149e0863ce743 Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 30 Jul 2008 17:52:06 +0000 Subject: 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 --- src/modules/m_operchans.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/modules') 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; } -- cgit v1.2.3