From 7c9d81ea86d59df03ef1837f686913867deeffda Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sat, 10 Oct 2020 03:15:43 -0500 Subject: Hard delete unpublished statuses when "unpublish on delete" is not enabled --- app/controllers/api/v1/statuses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/api') diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index b0cc95118..c7c429bfb 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -100,9 +100,9 @@ class Api::V1::StatusesController < Api::BaseController @status = Status.where(account_id: current_user.account).find(params[:id]) authorize @status, :destroy? - if !current_user.setting_unpublish_on_delete || !@status.published? || truthy_param?(:redraft) + if !(current_user.setting_unpublish_on_delete && @status.published?) || truthy_param?(:redraft) @status.discard - RemovalWorker.perform_async(@status.id, redraft: true, immediate: !current_user.setting_unpublish_on_delete) + RemovalWorker.perform_async(@status.id, redraft: true, unpublished: true) @status.account.statuses_count = @status.account.statuses_count - 1 else RemovalWorker.perform_async(@status.id, redraft: true, unpublish: true) -- cgit