about summary refs log tree commit diff
path: root/app/services/resolve_url_service.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-12-17 13:32:57 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-12-17 13:32:57 +0100
commit2ee5a9d9c319f187d4e94f6974654e1701e427eb (patch)
treec1be2da1f7068f9b99ede1b652f7afc9fce9bc0a /app/services/resolve_url_service.rb
parentda2143b3089ec16fca449b97acbfb65acfe92197 (diff)
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
Diffstat (limited to 'app/services/resolve_url_service.rb')
-rw-r--r--app/services/resolve_url_service.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/services/resolve_url_service.rb b/app/services/resolve_url_service.rb
index 4e971a4b8..79b1bad0c 100644
--- a/app/services/resolve_url_service.rb
+++ b/app/services/resolve_url_service.rb
@@ -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