Skip to content

Commit

Permalink
fix code quality errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aahnik committed Jun 4, 2021
1 parent e61c07f commit d07e570
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tgcf/plugins/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def text_safe(self, tm: TgcfMessage) -> bool:
# first check if any blacklisted pattern is present
for forbidden in flist.blacklist:
if match(forbidden, text, self.filters.text.regex):
return False # when a forbidden pattern is found
return False # when a forbidden pattern is found

if not flist.whitelist:
return True # if no whitelist is present
return True # if no whitelist is present

# if whitelist is present
for allowed in flist.whitelist:
if match(allowed, text, self.filters.text.regex):
return True # only when atleast one whitelisted pattern is found
return True # only when atleast one whitelisted pattern is found

def users_safe(self, tm: TgcfMessage) -> bool:
flist = self.filters.users
Expand Down

0 comments on commit d07e570

Please sign in to comment.