Signed-off-by: Emi Simpson <emi@alchemi.dev>
This commit is contained in:
Emi Simpson 2020-06-21 15:21:50 -04:00
parent c2fbf0934a
commit 1e47be497b
No known key found for this signature in database
GPG Key ID: 68FAB2E2E6DFC98B

View File

@ -29,7 +29,7 @@ export class WordList implements IProtection {
constructor() { constructor() {
// Create a mega-regex from all the tiny baby regexs // Create a mega-regex from all the tiny baby regexs
this.badWords = new RegExp( this.badWords = new RegExp(
"(" + config.protections.wordlist.words.join(")|(")+ ")", "(" + config.protections.wordlist.words.join(")|(") + ")",
"i" "i"
) )
} }
@ -53,7 +53,7 @@ export class WordList implements IProtection {
const now = new Date(); const now = new Date();
this.justJoined[roomId][event['state_key']] = now; this.justJoined[roomId][event['state_key']] = now;
LogService.info("WordList", `${event['state_key']} joined ${roomId} at ${now.toDateString()}`); LogService.info("WordList", `${event['state_key']} joined ${roomId} at ${now.toDateString()}`);
} else if (content['membership'] == 'leave' || content['membership'] == 'ban') { } else if (content['membership'] === 'leave' || content['membership'] === 'ban') {
delete this.justJoined[roomId][event['sender']] delete this.justJoined[roomId][event['sender']]
} }