added automatic unregistration of unvisited channel
[NeonServV5.git] / src / modules / NeonSpam.mod / bot_NeonSpam.c
index 33aa14e1856254e1fe86756d931a93c256c2cde0..5ccfbc2d82138e4028cd5beb6b6da11b12737745 100644 (file)
@@ -1,4 +1,4 @@
-/* bot_NeonSpam.c - NeonServ v5.3
+/* bot_NeonSpam.c - NeonServ v5.4
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -15,6 +15,7 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
  */
 #include "../module.h"
+#include "../botid.h"
 
 #include "bot_NeonSpam.h"
 #include "../../modcmd.h"
@@ -38,7 +39,7 @@
 #include "../../bots.h"
 #include "cmd_neonspam.h"
 
-#define BOTID 2
+#define BOTID NEONSPAM_BOTID
 #define BOTALIAS "NeonSpam"
 
 static const struct default_language_entry msgtab[] = {
@@ -234,6 +235,8 @@ int loadNeonSpamSettings(struct ChanNode *chan) {
     MYSQL_RES *res;
     MYSQL_ROW row, defaults = NULL;
     loadChannelSettings(chan);
+    if(!(chan->flags & CHANFLAG_CHAN_REGISTERED))
+        return 0;
     printf_mysql_query("SELECT `channel_scanner`, `channel_spam_limit`, `channel_spam_except`, `channel_flood_limit`, `channel_flood_time`, `channel_flood_except`, `channel_join_limit`, `channel_join_time`, `channel_join_except`, `channel_caps_percent`, `channel_caps_except`, `channel_digit_percent`, `channel_digit_except` FROM `channels` WHERE `channel_id` = '%d'", chan->channel_id);
     res = mysql_use();
     row = mysql_fetch_row(res);