0
0
Fork 0

Hook up URL-based resource look-up to ActivityPub (#4589)

This commit is contained in:
Eugen Rochko 2017-08-14 02:29:36 +02:00 committed by GitHub
parent a2aeacbfee
commit 4e75f0d889
8 changed files with 95 additions and 60 deletions

View file

@ -4,8 +4,8 @@ class ActivityPub::FetchRemoteStatusService < BaseService
include JsonLdHelper
# Should be called when uri has already been checked for locality
def call(uri)
@json = fetch_resource(uri)
def call(uri, prefetched_json = nil)
@json = body_to_json(prefetched_json) || fetch_resource(uri)
return unless supported_context? && expected_type?