about summary refs log tree commit diff
path: root/app/services/remove_status_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/remove_status_service.rb')
-rw-r--r--app/services/remove_status_service.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index 29c835051..d7bd2ae39 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -33,12 +33,7 @@ class RemoveStatusService < BaseService
         remove_from_spam_check unless @options[:unpublish]
         remove_media unless @options[:unpublish]
 
-        if @options[:immediate] || !(@options[:unpublish] || @status.reported?)
-          @status.destroy!
-        else
-          @status.update(published: false, expires_at: nil, local_only: @status.local?)
-          DistributionWorker.perform_async(@status.id) if @status.local?
-        end
+        @status.destroy! if @options[:immediate] || !(@options[:unpublish] || @status.reported?)
       else
         raise Mastodon::RaceConditionError
       end
@@ -54,6 +49,11 @@ class RemoveStatusService < BaseService
     remove_from_remote_followers
     remove_from_remote_affected
     remove_from_remote_shared
+
+    return unless @options[:unpublish]
+
+    @status.update(published: false, expires_at: nil, local_only: @status.local?)
+    DistributionWorker.perform_async(@status.id) if @status.local?
   end
 
   private