Fix filters in notifications

This commit is contained in:
Jason McBrayer 2019-04-02 14:31:10 -04:00
parent 1a14dd8c3b
commit 53a0938f7b

View File

@ -173,7 +173,9 @@ def toot_matches_filters(toot, filters=[]):
return filter.phrase
phrases = [maybe_rewrite_filter(x) for x in filters]
pattern = "|".join(phrases)
try:
try:
if toot.get('type') in ['reblog', 'favourite']:
return re.search(pattern, toot.status.spoiler_text + toot.status.content, re.I)
return re.search(pattern, toot.spoiler_text + toot.content, re.I)
except:
return False