]> jfr.im git - irc/quakenet/newserv.git/blobdiff - chanfix/chanfix.c
Remove test #ifs around the GL commands.
[irc/quakenet/newserv.git] / chanfix / chanfix.c
index 89868eda85c5161270214e77b5bc64b8f1ece464..9c8c93bcd84d37ca2d12de22a3efd38354c151b1 100644 (file)
@@ -14,6 +14,9 @@
 #include "../nick/nick.h"
 #include "../lib/irc_string.h"
 #include "../control/control.h"
+#include "../lib/version.h"
+
+MODULE_VERSION("")
 
 /* control's nick */
 extern nick *mynick;
@@ -103,14 +106,6 @@ void _init() {
 }
 
 void _fini() {
-  if (cfext >= 0) {
-    releasechanext(cfext);
-  }
-
-  if (cfnext >= 0) {
-    releasenickext(cfnext);
-  }
-
   if (cffailedinit == 0) {
     deleteschedule(NULL, &cfsched_dosample, NULL);
     deleteschedule(NULL, &cfsched_doexpire, NULL);
@@ -146,6 +141,14 @@ void _fini() {
     deregisterhook(HOOK_CORE_STATSREQUEST, &cfhook_statsreport);
     deregisterhook(HOOK_NICK_ACCOUNT, &cfhook_auth);
   }
+
+  if (cfext >= 0) {
+    releasechanext(cfext);
+  }
+
+  if (cfnext >= 0) {
+    releasenickext(cfnext);
+  }
 }
 
 int cfcmd_debug(void *source, int cargc, char **cargv) {
@@ -676,7 +679,6 @@ void cfsched_dosample(void *arg) {
   channel *cp;
   chanindex *cip;
   nick *np;
-  chanfix *cf;
   regop *ro, *roh;
   struct timeval start;
   struct timeval end;
@@ -693,7 +695,6 @@ void cfsched_dosample(void *arg) {
 
   for (i=0; i<CHANNELHASHSIZE; i++) {
     for (cip=chantable[i]; cip; cip=cip->next) {
-      cf = (chanfix*)cip->exts[cfext];
       cp = cip->channel;
 
       if (!cp || cp->users->totalusers < CFMINUSERS)
@@ -703,6 +704,9 @@ void cfsched_dosample(void *arg) {
         if ((cp->users->content[a] != nouser) && (cp->users->content[a] & CUMODE_OP)) {
           np = getnickbynumeric(cp->users->content[a]);
 
+          if (np)
+            continue;
+
 #if !CFDEBUG
           if (IsService(np))
             continue;