Refactor StatusReachFinder to be used in more places
This commit is contained in:
parent
c99d28369a
commit
ce463ccb50
13 changed files with 321 additions and 99 deletions
|
@ -39,7 +39,7 @@ class ActivityPub::DeliveryWorker
|
|||
Request.new(:post, @inbox_url, body: @json, http_client: http_client).tap do |request|
|
||||
request.on_behalf_of(@source_account, :uri, sign_with: @options[:sign_with])
|
||||
request.add_headers(HEADERS)
|
||||
request.add_headers({ 'Collection-Synchronization' => synchronization_header }) if ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] != 'true' && @options[:synchronize_followers]
|
||||
request.add_headers({ 'Collection-Synchronization' => synchronization_header }) if synchronize_followers?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -47,6 +47,14 @@ class ActivityPub::DeliveryWorker
|
|||
"collectionId=\"#{account_followers_url(@source_account)}\", digest=\"#{@source_account.remote_followers_hash(@inbox_url)}\", url=\"#{account_followers_synchronization_url(@source_account)}\""
|
||||
end
|
||||
|
||||
def synchronize_followers?
|
||||
followers_synchronization_enabled? && @options[:synchronize_followers]
|
||||
end
|
||||
|
||||
def followers_synchronization_enabled?
|
||||
ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] != 'true'
|
||||
end
|
||||
|
||||
def perform_request
|
||||
light = Stoplight(@inbox_url) do
|
||||
request_pool.with(@host) do |http_client|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue