|
|
@ -7,14 +7,14 @@ class ActivityPub::FetchRemoteAccountService < BaseService |
|
|
|
|
|
|
|
|
|
|
|
# Should be called when uri has already been checked for locality |
|
|
|
# Should be called when uri has already been checked for locality |
|
|
|
# Does a WebFinger roundtrip on each call |
|
|
|
# Does a WebFinger roundtrip on each call |
|
|
|
def call(uri, id: true, prefetched_body: nil) |
|
|
|
def call(uri, id: true, prefetched_body: nil, break_on_redirect: false) |
|
|
|
@json = if prefetched_body.nil? |
|
|
|
@json = if prefetched_body.nil? |
|
|
|
fetch_resource(uri, id) |
|
|
|
fetch_resource(uri, id) |
|
|
|
else |
|
|
|
else |
|
|
|
body_to_json(prefetched_body) |
|
|
|
body_to_json(prefetched_body) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
return unless supported_context? && expected_type? |
|
|
|
return if !supported_context? || !expected_type? || (break_on_redirect && @json['movedTo'].present?) |
|
|
|
|
|
|
|
|
|
|
|
@uri = @json['id'] |
|
|
|
@uri = @json['id'] |
|
|
|
@username = @json['preferredUsername'] |
|
|
|
@username = @json['preferredUsername'] |
|
|
|