summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
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);
+}