about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-09 12:47:33 +0200
committermultiple creatures <dev@multiple-creature.party>2019-11-19 16:49:57 -0600
commitcd1e1f28b8174c03104dfae03784526d15593607 (patch)
tree4a35618b8c319884db82b3dee0c5fe671e42dc4e /app/lib
parent001b0cbbc1434e30c360591d36edc7d5c17c3710 (diff)
Change priority of delete activity forwards for replies and reblogs (#11002)
Fix #11001
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activitypub/activity/delete.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/lib/activitypub/activity/delete.rb b/app/lib/activitypub/activity/delete.rb
index bf530ac49..b39c163f5 100644
--- a/app/lib/activitypub/activity/delete.rb
+++ b/app/lib/activitypub/activity/delete.rb
@@ -44,7 +44,7 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
     rebloggers_ids = @status.reblogs.includes(:account).references(:account).merge(Account.local).pluck(:account_id)
     inboxes        = Account.where(id: ::Follow.where(target_account_id: rebloggers_ids).select(:account_id)).inboxes - [@account.preferred_inbox_url]
 
-    ActivityPub::DeliveryWorker.push_bulk(inboxes) do |inbox_url|
+    ActivityPub::LowPriorityDeliveryWorker.push_bulk(inboxes) do |inbox_url|
       [payload, rebloggers_ids.first, inbox_url]
     end
   end
@@ -60,7 +60,12 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
 
   def forward_for_reply
     return unless @json['signature'].present? && reply_to_local?
-    ActivityPub::RawDistributionWorker.perform_async(Oj.dump(@json), replied_to_status.account_id, [@account.preferred_inbox_url])
+
+    inboxes = replied_to_status.account.followers.inboxes - [@account.preferred_inbox_url]
+
+    ActivityPub::LowPriorityDeliveryWorker.push_bulk(inboxes) do |inbox_url|
+      [payload, replied_to_status.account_id, inbox_url]
+    end
   end
 
   def delete_now!