diff options
-rw-r--r-- | include/users.h | 8 | ||||
-rw-r--r-- | src/channels.cpp | 5 | ||||
-rw-r--r-- | src/users.cpp | 7 |
3 files changed, 4 insertions, 16 deletions
diff --git a/include/users.h b/include/users.h index 503a1e568..b3de65941 100644 --- a/include/users.h +++ b/include/users.h @@ -258,7 +258,7 @@ public: */ unsigned long limit; - int GetMaxChans() + size_t GetMaxChans() { return maxchans; } @@ -456,10 +456,6 @@ class CoreExport User : public connection */ void DecrementModes(); - /** Max channels for this user - */ - unsigned int MaxChans; - std::map<std::string, bool>* AllowedOperCommands; /** Allowed user modes from oper classes. */ @@ -505,8 +501,6 @@ class CoreExport User : public connection */ void StartDNSLookup(); - unsigned int GetMaxChans(); - /** The users nickname. * An invalid nickname indicates an unregistered connection prior to the NICK command. * Use InspIRCd::IsNick() to validate nicknames. diff --git a/src/channels.cpp b/src/channels.cpp index 7f843eeeb..004acc3f8 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -215,9 +215,10 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool */ if (IS_LOCAL(user) && !override) { - if (user->GetMaxChans()) + // Checking MyClass exists because we *may* get here with NULL, not 100% sure. + if (user->MyClass && user->MyClass->GetMaxChans()) { - if (user->chans.size() >= user->GetMaxChans()) + if (user->chans.size() >= user->MyClass->GetMaxChans()) { user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn); return NULL; diff --git a/src/users.cpp b/src/users.cpp index 3e9baba72..243422558 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -861,7 +861,6 @@ void User::CheckClass() } this->nping = ServerInstance->Time() + a->GetPingTime() + ServerInstance->Config->dns_timeout; - this->MaxChans = a->GetMaxChans(); } bool User::CheckLines() @@ -1755,12 +1754,6 @@ void User::SplitChanList(User* dest, const std::string &cl) } } -unsigned int User::GetMaxChans() -{ - return this->MaxChans; -} - - /* * Sets a user's connection class. * If the class name is provided, it will be used. Otherwise, the class will be guessed using host/ip/ident/etc. |