fixed blocklist & tested it

repair-blocklist
missytake 2020-06-16 20:26:36 +02:00
parent e75f0996e6
commit 209ff7c92d
1 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@ from pylibscrypt import scrypt_mcf, scrypt_mcf_check
from os import urandom
import logging
logger = logging.getLogger(__name__)
class User(object):
def __init__(self, uid):
@ -95,11 +96,11 @@ schlitz
db.execute("SELECT words FROM badwords WHERE user_id=?;",
(self.uid, ))
badwords = db.cur.fetchone()
for word in report.text.lower().splitlines():
if word in badwords:
for word in report.text.lower().split():
if word in badwords[0].splitlines():
logger.error("Word " + word + " triggered the spam filter on message: " + report.text)
return False
for word in report.text.lower().splitlines():
for word in report.text.lower().split():
if word in default_badwords.splitlines():
logger.error("Word " + word + " triggered the spam filter on message: " + report.text)
return False