fetch_remote_account_service.rb 504 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. class FetchRemoteAccountService < BaseService
  3. def call(url, prefetched_body = nil, protocol = :ostatus)
  4. if prefetched_body.nil?
  5. resource_url, resource_options, protocol = FetchResourceService.new.call(url)
  6. else
  7. resource_url = url
  8. resource_options = { prefetched_body: prefetched_body }
  9. end
  10. case protocol
  11. when :activitypub
  12. ActivityPub::FetchRemoteAccountService.new.call(resource_url, **resource_options)
  13. end
  14. end
  15. end