diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:45:57 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:45:57 +0000 |
commit | 4219a6e4145c839f166fddf8a2d5889b32ca0346 (patch) | |
tree | f39224e9c20ed9b5b1fae3067591fe9b8d6c4118 /src/channels.cpp | |
parent | a30abe26fc803900eaf5dc4c08a31aa1d3c9c89f (diff) |
Use Config->MaxChans as the default if class does not define maxchans
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11946 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 5 |
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; |