闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
502 B

  1. # frozen_string_literal: true
  2. class FetchRemoteStatusService < 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::FetchRemoteStatusService.new.call(resource_url, **resource_options)
  13. end
  14. end
  15. end