summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index d0d8e52c5..a4c24b455 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -228,7 +228,10 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char
}
else
{
- if (user->chans.size() >= user->GetClass()->maxchans)
+ 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);
return NULL;