mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Added additional checks for new filter improvements
This commit is contained in:
parent
e5196f0aad
commit
a16f16d36d
@ -171,9 +171,19 @@ def filter_tweet(tweet, tweet_data, settings, buffer_name):
|
|||||||
if settings["filters"][i]["in_buffer"] == buffer_name:
|
if settings["filters"][i]["in_buffer"] == buffer_name:
|
||||||
regexp = settings["filters"][i]["regexp"]
|
regexp = settings["filters"][i]["regexp"]
|
||||||
word = settings["filters"][i]["word"]
|
word = settings["filters"][i]["word"]
|
||||||
|
# Added if/else for compatibility reasons.
|
||||||
|
if settings["filters"][i].has_key("allow_rts"):
|
||||||
allow_rts = settings["filters"][i]["allow_rts"]
|
allow_rts = settings["filters"][i]["allow_rts"]
|
||||||
|
else:
|
||||||
|
allow_rts = "True"
|
||||||
|
if settings["filters"][i].has_key("allow_quotes"):
|
||||||
allow_quotes = settings["filters"][i]["allow_quotes"]
|
allow_quotes = settings["filters"][i]["allow_quotes"]
|
||||||
|
else:
|
||||||
|
allow_quotes = "True"
|
||||||
|
if settings["filters"][i].has_key("allow_replies"):
|
||||||
allow_replies = settings["filters"][i]["allow_replies"]
|
allow_replies = settings["filters"][i]["allow_replies"]
|
||||||
|
else:
|
||||||
|
allow_replies = "True"
|
||||||
if allow_rts == "False" and tweet_data.has_key("retweet"):
|
if allow_rts == "False" and tweet_data.has_key("retweet"):
|
||||||
return False
|
return False
|
||||||
if allow_quotes == "False" and tweet_data.has_key("quote"):
|
if allow_quotes == "False" and tweet_data.has_key("quote"):
|
||||||
|
Loading…
Reference in New Issue
Block a user