only add ban timers with a duration lower than 7 days to the timeq (prevent counter...
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_addtimeban.c
index 38ce3804cb4a016f4a3a53293d7b0de64cefaa5c..8df4b39edd73be3eeaf15c881f78ea478bf79453 100644 (file)
@@ -129,10 +129,12 @@ static void neonserv_cmd_addtimeban_async1(struct ClientSocket *client, struct C
         }
     }
     char nameBuf[MAXLEN];
-    char banidBuf[20];
-    sprintf(nameBuf, "ban_%d", banid);
-    sprintf(banidBuf, "%d", banid);
-    timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf));
+    if(duration < 86400*7) {
+        char banidBuf[20];
+        sprintf(nameBuf, "ban_%d", banid);
+        sprintf(banidBuf, "%d", banid);
+        timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf));
+    }
     reply(textclient, user, "NS_TIMEBAN_DONE", mask, chan->name, timeToStr(user, duration, 2, nameBuf), match_count);
     logEvent(event);
 }