summaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-09 17:48:40 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-09 17:48:40 +0000
commit3cd1a24a51b9560a6dd6590b4a384f6b6942370d (patch)
tree5d412748be07a9cba449587e6ac659862c761fe3 /src/usermanager.cpp
parentdd2ace5916a8bb24801e74aa8b209d396e012d9b (diff)
Remove mode counter, not reliable and only used for umode +i
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12246 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 1e3e9fa72..afabf4047 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -392,10 +392,12 @@ void UserManager::ServerPrivmsgAll(const char* text, ...)
/* return how many users have a given mode e.g. 'a' */
int UserManager::ModeCount(const char mode)
{
- ModeHandler* mh = ServerInstance->Modes->FindMode(mode, MODETYPE_USER);
-
- if (mh)
- return mh->GetCount();
- else
- return 0;
+ int c = 0;
+ for(user_hash::iterator i = clientlist->begin(); i != clientlist->end(); ++i)
+ {
+ User* u = i->second;
+ if (u->modes[mode-65])
+ c++;
+ }
+ return c;
}