How can I add a filter of bad words/reserved names?

53 views
Skip to first unread message

deannas...@gmail.com

unread,
Mar 18, 2017, 10:28:46 PM3/18/17
to AJAX-chat
Hello all,

I am looking to add a filter to 0.8.8. At the moment anyone can name themseleves 'admin' or 'moderator' and anyone can spam links with 'http' 'www' 'com etc and anyone can spout potty mouth words off into chat rooms as i will not list it for obvious reasons.

thanks

Cuore di angelo

unread,
Mar 20, 2017, 5:59:38 PM3/20/17
to AJAX-chat

deannas...@gmail.com

unread,
Mar 20, 2017, 11:41:21 PM3/20/17
to ajax...@googlegroups.com
hi thanks, ive added it but nothing happens, i have the channel name 'Public' as default set as channel 0 

Cuore di angelo

unread,
Mar 21, 2017, 8:03:42 PM3/21/17
to ajax...@googlegroups.com
Make sure you've done this:
open: chat -> js -> custom.js
add at the end:

//bad words
ajaxChat.replaceCustomText = function(text) {
    text=text.replace(/badword1/gi, '###');
    text=text.replace(/badword2/gi, '###');
    text=text.replace(/badword3/gi, '###');
    text=text.replace(/badword4/gi, '###');
    text=text.replace(/badword5/gi, '###');
    return text;
}

Of course you can add more lines.
Replace the words badword1,2,3, etc. with those that you choose.
Save and close.

Then, delete your browser's history, go to chat and try to type a word, you should read "###" instead of the word. If desired, you can substituted for "###" with symbols of your choice, such as '# @ # @'








Matt
Reply all
Reply to author
Forward
Message has been deleted
0 new messages