Merge branch 'backbone_ui' of github.com:prawnsalad/KiwiIRC into backbone_ui
[KiwiIRC.git] / server / kiwi_modules / spamfilter.js
index 140ee49785db298b1e374834c87ab558eab927a2..5f3ff761dcbe5962e6c9c20885b6f2eb78cfbca9 100644 (file)
@@ -7,13 +7,16 @@ var filters;
 var compiled_regex;
 
 exports.onload = function(){
-       filters = ['sad', 'kill', 'death'];
-       compiled_regex = new RegExp(filters.join('|'), 'im');
+       filters = [];
+
+       if (filter.length > 0) {
+               compiled_regex = new RegExp(filters.join('|'), 'im');
+       }
 }
 
 
 exports.onmsg = function(msg){
-       if (msg.msg.search(compiled_regex) > -1) {
+       if (typeof compiled_regex !== 'undefined' && msg.msg.search(compiled_regex) > -1) {
                return null;
        }