aboutsummaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-08-13 16:56:24 -0400
committerGravatar Daniel De Graaf2010-08-13 16:56:24 -0400
commit7cfd4039ca3a835abfa88dfd595187fb11aa6901 (patch)
tree360b659045ea6a9b5b6d5227a7ff4da0e5ab4c44 /src/channels.cpp
parentRemove Limits.Finalise(), doing this is completely incorrect (diff)
Remove duplicated settings now solely defined by the <connect> class
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp27
1 files changed, 8 insertions, 19 deletions
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 <connect> 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 <connect> 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;
}
}