added NeonSpam Badword scanner
[NeonServV5.git] / src / modules / NeonSpam.mod / bot_NeonSpam.h
index aaeca2b25a256a60acf22a6d2dece667236d6a4d..1d4c68f6d7249215336447abdcbe8595da18f30f 100644 (file)
@@ -69,17 +69,23 @@ struct ChanNode;
 #define SPAMSETTINGS_DIGITEXCINDEX      5
 #define SPAMSETTINGS_DIGITPERCENTINDEX  1
 
-
-#define SPAMSETTINGS_CHARS     SPAMSETTINGS_SPAMCHARS SPAMSETTINGS_FLOODCHARS SPAMSETTINGS_JOINCHARS SPAMSETTINGS_BOTNETCHARS SPAMSETTINGS_CAPSCHARS SPAMSETTINGS_DIGITCHARS
-#define SPAMSETTINGS_FLAGS              0x07ffff /* all flags that can be stored in the database */
-#define SPAMSETTINGS_EXCEPTINDEXES      6
+//BADWORDSCAN
+#define SPAMSETTINGS_BADWORDSCAN        0x080000
+#define SPAMSETTINGS_BADWORDSCAN_OPS    0x100000
+#define SPAMSETTINGS_BADWORDSCAN_VOICE  0x200000
+#define SPAMSETTINGS_BADWORDCHARS       "tuv"
+#define SPAMSETTINGS_BADWORDEXCINDEX    6
+
+#define SPAMSETTINGS_CHARS     SPAMSETTINGS_SPAMCHARS SPAMSETTINGS_FLOODCHARS SPAMSETTINGS_JOINCHARS SPAMSETTINGS_BOTNETCHARS SPAMSETTINGS_CAPSCHARS SPAMSETTINGS_DIGITCHARS SPAMSETTINGS_BADWORDCHARS
+#define SPAMSETTINGS_FLAGS              0x7fffff /* all flags that can be stored in the database */
+#define SPAMSETTINGS_EXCEPTINDEXES      7
 #define SPAMSETTINGS_SENSIBILITYINDEXES 2
 #define SPAMSETTINGS_PERCENTINDEXES     2
 
 //SCRIPT FLAGS
-#define SPAMSETTINGS_KICKEDBOTQUEUE     0x080000
-#define SPAMSETTINGS_ISTIMEBAN          0x100000
-#define SPAMSETTINGS_SETTIMEBAN         0x200000
+#define SPAMSETTINGS_KICKEDBOTQUEUE     0x0400000
+#define SPAMSETTINGS_ISTIMEBAN          0x0800000
+#define SPAMSETTINGS_SETTIMEBAN         0x1000000
 
 #define MAX_FLOOD_AMOUNT 300
 #define MIN_FLOOD_AMOUNT 2
@@ -108,8 +114,23 @@ struct NeonSpamSettings {
     time_t lastmsg_time;
     char *botnicks[BOTNETSCAN_USERS];
     
-    
+    //badword scan
+    struct NeonSpamBadword *badwords;
 };
+
+struct NeonSpamBadword {
+    int id;
+    char *badword;
+    unsigned char use_defaults : 1;
+    unsigned int exceptlevel : 9;
+    unsigned char scan_ops : 1;
+    unsigned char scan_voice : 1;
+    unsigned char use_default_reaction : 1;
+    unsigned int reaction;
+    unsigned int reaction_time;
+    struct NeonSpamBadword *next;
+};
+
 /* PENALTY SYSTEM
 * user gets MAX_FLOOD_TIME points per message
 * points get removed each loop