about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/services/remove_status_service.rb8
-rw-r--r--app/services/suspend_account_service.rb5
2 files changed, 8 insertions, 5 deletions
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index 4e03661da..fa55e668e 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -11,10 +11,10 @@ class RemoveStatusService < BaseService
 
     status.destroy!
 
-    if status.account.local?
-      HubPingWorker.perform_async(status.account.id)
-      Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
-    end
+    return unless status.account.local?
+
+    HubPingWorker.perform_async(status.account.id)
+    Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
   end
 
   private
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index 729bf42fe..04a086613 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -12,8 +12,11 @@ class SuspendAccountService < BaseService
   private
 
   def purge_content
+    @account.statuses.find_each do |status|
+      RemoveStatusService.new.call(status)
+    end
+
     @account.media_attachments.destroy_all
-    @account.statuses.destroy_all
     @account.stream_entries.destroy_all
     @account.mentions.destroy_all
     @account.notifications.destroy_all