]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Ignore +k/+X users for chanstats purposes.
authorChris Porter <redacted>
Thu, 14 Feb 2008 17:14:48 +0000 (17:14 +0000)
committerChris Porter <redacted>
Thu, 14 Feb 2008 17:14:48 +0000 (17:14 +0000)
chanstats/chanstats.c

index d9c1fba698a03c0468d44ea5bacb15e24e87a6af..67a877bd0c1f3a5c1a63cbd1efe145bbee79993e 100644 (file)
@@ -154,7 +154,25 @@ void updatechanstats(chanindex *cip, time_t now) {
   }
 
   if (cip->channel!=NULL) {
-    currentusers=countuniquehosts(cip->channel);
+    channel *cp = cip->channel;
+    int i;
+    nick *np;
+
+    currentusers=countuniquehosts(cp);
+
+    for (i=0;i<cp->users->hashsize;i++) {
+      if (cp->users->content[i]==nouser)
+        continue;
+
+      if ((np=getnickbynumeric(cp->users->content[i]))==NULL) {
+        Error("channel",ERR_ERROR,"Found unknown numeric %u on channel %s",cp->users->content[i],cp->index->name->content);
+        continue;
+      }
+
+      if (IsXOper(np) || IsService(np))
+        currentusers--;
+    }
+
     csp->todaysamples++;
   } else {
     currentusers=0;