From ee44af8d04f23b4a16c9b377764f930d69e575f7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 27 Nov 2022 07:32:42 +0000 Subject: Refactor the internals of the oper system. - Allow overriding privileges from the blocks in the and blocks. - Separate oper types from oper accounts in the code. This enables moving some core stuff out of the config tag later. - Merge the config tags together to make a synthetic tag that can have getXXX called on it instead of using getConfig and then converting it. - Move the details of Have*Permission into the oper type class. - Improve oper events to allow modules to easily hook into the oper system. --- src/channels.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 591f3368b..d98bcc123 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -188,11 +188,8 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co { unsigned long maxchans = user->GetClass()->maxchans; if (user->IsOper()) - { - unsigned long opermaxchans = ConvToNum(user->oper->getConfig("maxchans")); - if (opermaxchans > maxchans) - maxchans = opermaxchans; - } + maxchans = user->oper->GetConfig()->getUInt("maxchans", maxchans, maxchans); + if (user->chans.size() >= maxchans) { user->WriteNumeric(ERR_TOOMANYCHANNELS, cname, "You are on too many channels"); -- cgit v1.3.1-10-gc9f91