diff options
author | Jonathan de Jong <jonathandejong02@gmail.com> | 2023-10-27 16:55:00 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-12-04 15:28:02 +0100 |
commit | 8bbe2b970f8cd0c62c83616886c7084d9c93c167 (patch) | |
tree | 4c3d316d009e2cbfecae94bf163c83acee9eb49b | |
parent | 803e15a3cfe1a21661258b40e5276af29b676481 (diff) |
Have `Follow` activities bypass availability (#27586)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
-rw-r--r-- | app/services/follow_service.rb | 2 | ||||
-rw-r--r-- | app/workers/activitypub/delivery_worker.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb index feea40e3c0a..1aa0241fe62 100644 --- a/app/services/follow_service.rb +++ b/app/services/follow_service.rb @@ -71,7 +71,7 @@ class FollowService < BaseService if @target_account.local? LocalNotificationWorker.perform_async(@target_account.id, follow_request.id, follow_request.class.name, 'follow_request') elsif @target_account.activitypub? - ActivityPub::DeliveryWorker.perform_async(build_json(follow_request), @source_account.id, @target_account.inbox_url) + ActivityPub::DeliveryWorker.perform_async(build_json(follow_request), @source_account.id, @target_account.inbox_url, { 'bypass_availability' => true }) end follow_request diff --git a/app/workers/activitypub/delivery_worker.rb b/app/workers/activitypub/delivery_worker.rb index 7c1c14766b7..376c237a984 100644 --- a/app/workers/activitypub/delivery_worker.rb +++ b/app/workers/activitypub/delivery_worker.rb @@ -23,9 +23,10 @@ class ActivityPub::DeliveryWorker HEADERS = { 'Content-Type' => 'application/activity+json' }.freeze def perform(json, source_account_id, inbox_url, options = {}) - return unless DeliveryFailureTracker.available?(inbox_url) - @options = options.with_indifferent_access + + return unless @options[:bypass_availability] || DeliveryFailureTracker.available?(inbox_url) + @json = json @source_account = Account.find(source_account_id) @inbox_url = inbox_url |