Skip to content

Commit

Permalink
remove account on_behalf_of entirely since it doesn't do anything in …
Browse files Browse the repository at this point in the history
…this context anyway
  • Loading branch information
sneakers-the-rat committed Oct 15, 2024
1 parent e712283 commit a84a391
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ AUTOFOLLOW=
# When a user expands a post (DetailedStatus view), fetch all of its replies
# (default: true if unset, set explicitly to ``false`` to disable)
FETCH_REPLIES_ENABLED=true

# Period to wait between fetching replies (in minutes)
FETCH_REPLIES_DEBOUNCE=15

# Period to wait after a post is first created before fetching its replies (in minutes)
FETCH_REPLIES_CREATED_RECENTLY=5

Expand Down
1 change: 0 additions & 1 deletion app/controllers/api/v1/statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def context
if !current_account.nil? && @status.should_fetch_replies?
ActivityPub::FetchAllRepliesWorker.perform_async(
@status.id,
current_account.id,
{
allow_synchronous_requests: true,
}
Expand Down
6 changes: 2 additions & 4 deletions app/workers/activitypub/fetch_all_replies_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class ActivityPub::FetchAllRepliesWorker
# Global max replies to fetch per request (all replies, recursively)
MAX_REPLIES = 1000

def perform(parent_status_id, current_account_id = nil, options = {})
def perform(parent_status_id, options = {})
@parent_status = Status.find(parent_status_id)
@current_account_id = current_account_id
@current_account = @current_account_id.nil? ? nil : Account.find(@current_account_id)
Rails.logger.debug { "FetchAllRepliesWorker - #{parent_status_id}: Fetching all replies for status: #{@parent_status}" }

uris_to_fetch = get_replies(@parent_status.uri, options)
Expand Down Expand Up @@ -50,7 +48,7 @@ def get_replies(status_uri, options = {})

def get_replies_uri(parent_status_uri)
begin
json_status = fetch_resource(parent_status_uri, true, @current_account)
json_status = fetch_resource(parent_status_uri, true)
replies_collection_or_uri = json_status['replies']
Rails.logger.debug { "FetchAllRepliesWorker - #{@parent_status_id}: replies URI was nil" } if replies_collection_or_uri.nil?
replies_collection_or_uri
Expand Down

0 comments on commit a84a391

Please sign in to comment.