summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-21 17:11:02 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-21 17:11:02 +0000
commit7e94b3110480efd4ef1e46cd44dc31c46aa9f8a7 (patch)
tree4ac454cc152023cf8affa8052d5820f6463deaf9 /src
parent33d11457b46d8757142b3ab4bcac890619183c98 (diff)
Remove duplicated member, kept in classes.. Possible now we have a pointer. this saves (another) 4 bytes per user.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10064 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp5
-rw-r--r--src/users.cpp7
2 files changed, 3 insertions, 9 deletions
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.