Clean up OStatus-related codepaths (#12173)
* Remove “protocol” argument and return value, as only ActivityPub is supported * Remove FetchRemoteAccountService, only use ActivityPub::FetchRemoteAccountService * Fix tests
This commit is contained in:
parent
da2143b308
commit
2ee5a9d9c3
8 changed files with 15 additions and 90 deletions
|
@ -19,9 +19,9 @@ class ResolveURLService < BaseService
|
|||
|
||||
def process_url
|
||||
if equals_or_includes_any?(type, ActivityPub::FetchRemoteAccountService::SUPPORTED_TYPES)
|
||||
FetchRemoteAccountService.new.call(resource_url, body, protocol)
|
||||
ActivityPub::FetchRemoteAccountService.new.call(resource_url, prefetched_body: body)
|
||||
elsif equals_or_includes_any?(type, ActivityPub::Activity::Create::SUPPORTED_TYPES + ActivityPub::Activity::Create::CONVERTED_TYPES)
|
||||
status = FetchRemoteStatusService.new.call(resource_url, body, protocol)
|
||||
status = FetchRemoteStatusService.new.call(resource_url, body)
|
||||
authorize_with @on_behalf_of, status, :show? unless status.nil?
|
||||
status
|
||||
elsif fetched_resource.nil? && @on_behalf_of.present?
|
||||
|
@ -45,12 +45,8 @@ class ResolveURLService < BaseService
|
|||
fetched_resource.second[:prefetched_body]
|
||||
end
|
||||
|
||||
def protocol
|
||||
fetched_resource.third
|
||||
end
|
||||
|
||||
def type
|
||||
return json_data['type'] if protocol == :activitypub
|
||||
json_data['type']
|
||||
end
|
||||
|
||||
def json_data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue