about summary refs log tree commit diff
path: root/app/services/suspend_account_service.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-02-12 05:10:43 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-02-12 05:10:43 +0100
commit99c4b5b75ad8856f6e05e6a838abacc755a7b183 (patch)
tree1c01a5338b3858044dfc4dc2d9defebf99ebf493 /app/services/suspend_account_service.rb
parent0e513ff862faf7fa9e5b89d2ab7d22fd0ab540ff (diff)
Move sending account Delete to anyone but the account's followers to the pull̀ queue (#10016)
Diffstat (limited to 'app/services/suspend_account_service.rb')
-rw-r--r--app/services/suspend_account_service.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index 1bc2314de..fc3bc03a5 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -102,6 +102,10 @@ class SuspendAccountService < BaseService
     ActivityPub::DeliveryWorker.push_bulk(delivery_inboxes) do |inbox_url|
       [delete_actor_json, @account.id, inbox_url]
     end
+
+    ActivityPub::LowPriorityDeliveryWorker.push_bulk(low_priority_delivery_inboxes) do |inbox_url|
+      [delete_actor_json, @account.id, inbox_url]
+    end
   end
 
   def delete_actor_json
@@ -117,7 +121,11 @@ class SuspendAccountService < BaseService
   end
 
   def delivery_inboxes
-    Account.inboxes + Relay.enabled.pluck(:inbox_url)
+    @delivery_inboxes ||= @account.followers.inboxes + Relay.enabled.pluck(:inbox_url)
+  end
+
+  def low_priority_delivery_inboxes
+    Account.inboxes - delivery_inboxes
   end
 
   def associations_for_destruction