0
0
Fork 0

Fetch boosted statuses on behalf of a follower (fixes #7426) (#7459)

When an ActivityPub Announce is processed and the boosted toot is not known,
fetch it on behalf of one of the booster's followers. This is to allow
fetching self-boosts of previously-unknown private toots.

If fetching on behalf of a user fails, try fetching it anonymously: the
selected follower of a boosting user may be banned by the boosted toot's
author.
This commit is contained in:
ThibG 2018-05-12 16:48:32 +02:00 committed by Eugen Rochko
parent f9afd06221
commit 7467361d70
3 changed files with 13 additions and 8 deletions

View file

@ -4,9 +4,9 @@ class ActivityPub::FetchRemoteStatusService < BaseService
include JsonLdHelper
# Should be called when uri has already been checked for locality
def call(uri, id: true, prefetched_body: nil)
def call(uri, id: true, prefetched_body: nil, on_behalf_of: nil)
@json = if prefetched_body.nil?
fetch_resource(uri, id)
fetch_resource(uri, id, on_behalf_of)
else
body_to_json(prefetched_body)
end