From f190e3c8c4840e6f92b90d913096e80eafc893eb Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sat, 19 Sep 2020 16:56:21 -0500 Subject: [Federation] Add support for distributing ActivityPub events to all unsuspended inboxes --- app/workers/activitypub/distribution_worker.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/workers/activitypub/distribution_worker.rb') diff --git a/app/workers/activitypub/distribution_worker.rb b/app/workers/activitypub/distribution_worker.rb index 716d751c4..ff4bac018 100644 --- a/app/workers/activitypub/distribution_worker.rb +++ b/app/workers/activitypub/distribution_worker.rb @@ -6,7 +6,8 @@ class ActivityPub::DistributionWorker sidekiq_options queue: 'push' - def perform(status_id) + def perform(status_id, options = {}) + @options = options.with_indifferent_access @status = Status.find(status_id) @account = @status.account @payload = {} @@ -33,6 +34,8 @@ class ActivityPub::DistributionWorker end def inboxes + return Account.remote.without_suspended.inboxes if @options[:all_servers] || @account.id == -99 + # Deliver the status to all followers. # If the status is a reply to another local status, also forward it to that # status' authors' followers. -- cgit