summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/inspircd.h1
-rw-r--r--include/modules.h4
-rw-r--r--src/modules.cpp5
3 files changed, 10 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index f38ee47be..442211ea1 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -111,4 +111,5 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key);
chanrec* del_channel(userrec *user, const char* cname, const char* reason);
void force_nickchange(userrec* user,const char* newnick);
void kill_link(userrec *user,const char* r);
+int usercount(chanrec *c);
diff --git a/include/modules.h b/include/modules.h
index 9b6bd0bd8..c7fd780bd 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -318,6 +318,10 @@ class Server : public classbase
* Nicks for unregistered connections will return false.
*/
virtual bool IsNick(std::string nick);
+ /** Returns a count of the number of users on a channel.
+ * This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
+ */
+ virtual int CountUsers(chanrec* c);
/** Attempts to look up a nick and return a pointer to it.
* This function will return NULL if the nick does not exist.
*/
diff --git a/src/modules.cpp b/src/modules.cpp
index 46b24de7b..2f7f1fd16 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -310,6 +310,11 @@ bool Server::AddExtendedMode(char modechar, int type, bool requires_oper, int pa
return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off);
}
+int Server::CountUsers(chanrec* c)
+{
+ return usercount(c);
+}
+
ConfigReader::ConfigReader()
{