From ff3eef491aa9e107d09d9dd9560ef7715b37b3b3 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 21 Oct 2009 23:45:32 +0000 Subject: Move all local-only fields to LocalUser git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11944 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index d7f8f372e..d0d8e52c5 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -218,24 +218,20 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char */ if (IS_LOCAL(user) && !override) { - // Checking MyClass exists because we *may* get here with NULL, not 100% sure. - if (user->MyClass && user->MyClass->maxchans) + if (user->HasPrivPermission("channels/high-join-limit")) { - if (user->HasPrivPermission("channels/high-join-limit")) + if (user->chans.size() >= ServerInstance->Config->OperMaxChans) { - if (user->chans.size() >= ServerInstance->Config->OperMaxChans) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn); - return NULL; - } + user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn); + return NULL; } - else + } + else + { + if (user->chans.size() >= user->GetClass()->maxchans) { - if (user->chans.size() >= user->MyClass->maxchans) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn); - return NULL; - } + user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn); + return NULL; } } } @@ -291,7 +287,7 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char else if (MOD_RESULT == MOD_RES_PASSTHRU) { std::string ckey = Ptr->GetModeParameter('k'); - bool invited = user->IsInvited(Ptr->name.c_str()); + bool invited = IS_LOCAL(user)->IsInvited(Ptr->name.c_str()); bool can_bypass = ServerInstance->Config->InvBypassModes && invited; if (!ckey.empty()) @@ -338,7 +334,7 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char */ if (invited) { - user->RemoveInvite(Ptr->name.c_str()); + IS_LOCAL(user)->RemoveInvite(Ptr->name.c_str()); } } } -- cgit v1.2.3