From 4219a6e4145c839f166fddf8a2d5889b32ca0346 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 21 Oct 2009 23:45:57 +0000 Subject: 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 --- src/channels.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3