From c511bb56f5ceff1e395d82c4bfd78e5c23aabab6 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 19 Mar 2014 20:52:56 +0000 Subject: Kill in favour of and . Remove channels/high-join-limit privilege --- src/channels.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 089b6927e..46f9cfe89 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -161,30 +161,26 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co /* * We don't restrict the number of channels that remote users or users that are override-joining may be in. - * We restrict local users to MaxChans channels. - * We restrict local operators to OperMaxChans channels. + * We restrict local users to channels. + * We restrict local operators to channels. * This is a lot more logical than how it was formerly. -- w00t */ if (!override) { - if (user->HasPrivPermission("channels/high-join-limit")) + unsigned int maxchans = user->GetClass()->maxchans; + if (user->IsOper()) { - if (user->chans.size() >= ServerInstance->Config->OperMaxChans) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s :You are on too many channels", cname.c_str()); - return NULL; - } + unsigned int opermaxchans = ConvToInt(user->oper->getConfig("maxchans")); + // If not set, use 2.0's , if that's not set either, use limit from CC + if (!opermaxchans) + opermaxchans = ServerInstance->Config->OperMaxChans; + if (opermaxchans) + maxchans = opermaxchans; } - else + if (user->chans.size() >= maxchans) { - unsigned int maxchans = user->GetClass()->maxchans; - if (!maxchans) - maxchans = ServerInstance->Config->MaxChans; - if (user->chans.size() >= maxchans) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s :You are on too many channels", cname.c_str()); - return NULL; - } + user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s :You are on too many channels", cname.c_str()); + return NULL; } } -- cgit v1.3.1-10-gc9f91