*** VERSION 5.6.0 ***
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_addtimeban.c
index e2d0dc1b2f68b2f180a019710efee509cd3f2aab..da4ff6a398c4b9c5d55826e318cdb6211b9ba196 100644 (file)
@@ -1,4 +1,4 @@
-/* cmd_neonserv_addtimeban.c - NeonServ v5.4
+/* cmd_neonserv_addtimeban.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -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);
 }