fixed blocklist & tested it
parent
e75f0996e6
commit
209ff7c92d
7
user.py
7
user.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue