From f2cdc30c9e2f152c551431bcb70627904a326d45 Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 27 Dec 2017 21:25:09 +0100 Subject: [PATCH] fix #17 ignore fav on retweets im not sure how it works on mastodon so i just took the safe option --- tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks.py b/tasks.py index 62155ae..bb88678 100644 --- a/tasks.py +++ b/tasks.py @@ -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