From 7cfd4039ca3a835abfa88dfd595187fb11aa6901 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Fri, 13 Aug 2010 16:56:24 -0400 Subject: Remove duplicated settings now solely defined by the class --- src/channels.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index ee9cb7227..1d614b1e4 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -209,30 +209,19 @@ Channel* Channel::JoinUser(User *user, const std::string& cn, bool override, con /* * 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 the maximum defined in their block * This is a lot more logical than how it was formerly. -- w00t */ if (IS_LOCAL(user) && !override) { - if (user->HasPrivPermission("channels/high-join-limit")) + unsigned int maxchans = user->GetClass()->maxchans; + // default if not set in is 20 + if (!maxchans) + maxchans = 20; + if (user->chans.size() >= maxchans) { - if (user->chans.size() >= ServerInstance->Config->OperMaxChans) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn.c_str()); - return NULL; - } - } - else - { - unsigned int maxchans = user->GetClass()->maxchans; - if (!maxchans) - maxchans = ServerInstance->Config->MaxChans; - if (user->chans.size() >= maxchans) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn.c_str()); - return NULL; - } + user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn.c_str()); + return NULL; } } -- cgit v1.3.1-10-gc9f91