summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-26 15:14:05 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-26 15:14:05 +0000
commit90b9864a0ec58f1ad5afdd9bdd7dc51039c23562 (patch)
tree0e662a435d91c78ab19f4eebbc80393446f6d64b /src/channels.cpp
parent1f56002af538fe6e2ddaecb96add7053245ad3ad (diff)
Added channel 'counter', increases speed of quits, parts, kicks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1194 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 05bc7fa0d..41ca0468f 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -117,7 +117,7 @@ chanrec::chanrec()
strcpy(topic,"");
strcpy(setby,"");
strcpy(key,"");
- created = topicset = limit = 0;
+ created = topicset = limit = users = 0;
topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
}
@@ -197,3 +197,21 @@ std::string chanrec::GetModeParameter(char mode)
}
return std::string("");
}
+
+void chanrec::IncUserCounter()
+{
+ this->users++;
+ log(DEBUG,"Incremented channel user count for %s to %lu",name,(unsigned long)users);
+}
+
+void chanrec::DecUserCounter()
+{
+ if (this->users > 0)
+ this->users--;
+ log(DEBUG,"Decremented channel user count for %s to %lu",name,(unsigned long)users);
+}
+
+long chanrec::GetUserCounter()
+{
+ return (this->users);
+}