about summary refs log tree commit diff
path: root/app/services/activitypub
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-05-12 16:48:32 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-05-12 16:48:32 +0200
commit7467361d706e38aa53b6bd2fcb919153327175ed (patch)
treee08c62ee1b6695f7c22fe9f337d5a7c1592398ed /app/services/activitypub
parentf9afd06221baf7f635b346dfbe350652ba6ffbd0 (diff)
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.
Diffstat (limited to 'app/services/activitypub')
-rw-r--r--app/services/activitypub/fetch_remote_status_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/activitypub/fetch_remote_status_service.rb b/app/services/activitypub/fetch_remote_status_service.rb
index b6c00a9e7..2b447abb3 100644
--- a/app/services/activitypub/fetch_remote_status_service.rb
+++ b/app/services/activitypub/fetch_remote_status_service.rb
@@ -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