fix #17 ignore fav on retweets

im not sure how it works on mastodon so i just took the safe option
This commit is contained in:
codl 2017-12-27 21:25:09 +01:00
parent 3c6a9e4158
commit f2cdc30c9e
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 4 additions and 4 deletions

View File

@ -177,8 +177,8 @@ def delete_from_account(account_id):
if posts:
eligible = list(( # nosec
post for post in posts if
(not account.policy_keep_favourites or not post.favourite)
and (not account.policy_keep_media or not post.has_media)
(not account.policy_keep_favourites or not post.favourite or post.is_reblog)
and (not account.policy_keep_media or not post.has_media or post.is_reblog)
))
if eligible:
to_delete = random.choice(eligible)
@ -187,8 +187,8 @@ def delete_from_account(account_id):
for post in posts:
refreshed = refresh_posts((post,))
if refreshed and \
(not account.policy_keep_favourites or not post.favourite) \
and (not account.policy_keep_media or not post.has_media)\
(not account.policy_keep_favourites or not post.favourite or post.is_reblog) \
and (not account.policy_keep_media or not post.has_media or post.is_reblog)\
and (not account.policy_keep_direct or not post.direct):
to_delete = refreshed[0]
break