Cache clearing, default channel bug fix, embedded image clicking bug fix
[KiwiIRC.git] / node / kiwi_modules / spamfilter.js
CommitLineData
939e638d
D
1/*
2 * Example Kiwi module.
3 * This is by no means is a production ready module.
4 */
5
6var filters;
7var compiled_regex;
8
9exports.onload = function(){
10 filters = ['sad', 'kill', 'death'];
11 compiled_regex = new RegExp(filters.join('|'), 'im');
12}
13
14
15exports.onmsg = function(msg){
16 if (msg.msg.search(compiled_regex) > -1) {
17 return null;
18 }
19
20 return msg;
21}