about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-10-27 19:20:43 -0500
committerFire Demon <firedemon@creature.cafe>2020-10-28 19:05:51 -0500
commitecaf21464226b5cecc6d100165f7d1265afdffb9 (patch)
tree2bca30f3b22dfed6cf4827c0bb37c61371eb0a7e /app/services
parentd4eeebb57c4e21f908ad5bbae2b920c31b711dd5 (diff)
Do not deliver deletes to servers which a user has had no contact
Diffstat (limited to 'app/services')
-rw-r--r--app/services/remove_status_service.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index 4d07632d3..8025f235b 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -48,7 +48,6 @@ class RemoveStatusService < BaseService
 
     remove_from_remote_followers
     remove_from_remote_affected
-    remove_from_remote_shared
 
     @status.mentions.where(account_id: @options[:blocking]).destroy_all if @options[:blocking]
 
@@ -106,6 +105,10 @@ class RemoveStatusService < BaseService
       [signed_activity_json, @account.id, inbox_url]
     end
 
+    ActivityPub::DeliveryWorker.push_bulk(@account.following.inboxes) do |inbox_url|
+      [signed_activity_json, @account.id, inbox_url]
+    end
+
     relay! if relayable?
   end
 
@@ -119,12 +122,6 @@ class RemoveStatusService < BaseService
     end
   end
 
-  def remove_from_remote_shared
-    ActivityPub::DeliveryWorker.push_bulk(Account.remote.activitypub.where.not(shared_inbox_url: '').distinct.select(:shared_inbox_url).pluck(:shared_inbox_url)) do |inbox_url|
-      [signed_activity_json, @account.id, inbox_url]
-    end
-  end
-
   def signed_activity_json
     @signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? && @status.spoiler_text.blank? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account))
   end