From 2ee5a9d9c319f187d4e94f6974654e1701e427eb Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 17 Dec 2019 13:32:57 +0100 Subject: Clean up OStatus-related codepaths (#12173) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove “protocol” argument and return value, as only ActivityPub is supported * Remove FetchRemoteAccountService, only use ActivityPub::FetchRemoteAccountService * Fix tests --- app/services/fetch_remote_status_service.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'app/services/fetch_remote_status_service.rb') diff --git a/app/services/fetch_remote_status_service.rb b/app/services/fetch_remote_status_service.rb index 208dc7809..21d277aff 100644 --- a/app/services/fetch_remote_status_service.rb +++ b/app/services/fetch_remote_status_service.rb @@ -1,17 +1,14 @@ # frozen_string_literal: true class FetchRemoteStatusService < BaseService - def call(url, prefetched_body = nil, protocol = :ostatus) + def call(url, prefetched_body = nil) if prefetched_body.nil? - resource_url, resource_options, protocol = FetchResourceService.new.call(url) + resource_url, resource_options = FetchResourceService.new.call(url) else resource_url = url resource_options = { prefetched_body: prefetched_body } end - case protocol - when :activitypub - ActivityPub::FetchRemoteStatusService.new.call(resource_url, **resource_options) - end + ActivityPub::FetchRemoteStatusService.new.call(resource_url, **resource_options) end end -- cgit From a391eaf4d81d5b7a2e5d7e2106f3e119867e1a9b Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Thu, 19 Dec 2019 00:54:03 +0900 Subject: Fix an error when ActivityPub::FetchRemoteStatusService url is called with nil (#12652) --- app/services/fetch_remote_status_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services/fetch_remote_status_service.rb') diff --git a/app/services/fetch_remote_status_service.rb b/app/services/fetch_remote_status_service.rb index 21d277aff..eafde4d4a 100644 --- a/app/services/fetch_remote_status_service.rb +++ b/app/services/fetch_remote_status_service.rb @@ -9,6 +9,6 @@ class FetchRemoteStatusService < BaseService resource_options = { prefetched_body: prefetched_body } end - ActivityPub::FetchRemoteStatusService.new.call(resource_url, **resource_options) + ActivityPub::FetchRemoteStatusService.new.call(resource_url, **resource_options) unless resource_url.nil? end end -- cgit