Skip to content

Commit 85a40d6

Browse files
committed
filtration was improperly checking message contents as it was basically done wrong, this implements the behavior that was desired when it originally was quickly added as a reaction
1 parent a4d6e43 commit 85a40d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sogs/filtration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55

66
def should_drop_message_with_body(body):
7-
body = message_body(body)
87
"""return true if we should drop a message given its body"""
98
if os.path.exists(config.BAD_WORDS_FILE):
9+
body = message_body(body)
10+
if body is None:
11+
# this is invalid data so filter it out
12+
return True
1013
with open(config.BAD_WORDS_FILE, 'rb') as f:
1114
for line in f:
1215
word = line.rstrip()

0 commit comments

Comments
 (0)