about summary refs log tree commit diff
path: root/app/services/fetch_atom_service.rb
diff options
context:
space:
mode:
authorSurinna Curtis <ekiru.0@gmail.com>2018-05-02 05:40:24 -0500
committerEugen Rochko <eugen@zeonfederated.com>2018-05-02 12:40:24 +0200
commitdc786c0cf4467ade8db7d8b17e09f16923bfc1e8 (patch)
tree955931c945e9137b4883571cfd2d23bec1d59397 /app/services/fetch_atom_service.rb
parent86efccce2a874d16aa783d989ff4824bcfac40b5 (diff)
Support Actors/Statuses with multiple types (#7305)
* Add equals_or_includes_any? helper in JsonLdHelper

* Support arrays in JSON-LD type fields for actors/tags/objects.

* Spec for resolving accounts with extension types

* Style tweaks for codeclimate
Diffstat (limited to 'app/services/fetch_atom_service.rb')
-rw-r--r--app/services/fetch_atom_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/fetch_atom_service.rb b/app/services/fetch_atom_service.rb
index 0444baf74..550e75f33 100644
--- a/app/services/fetch_atom_service.rb
+++ b/app/services/fetch_atom_service.rb
@@ -42,7 +42,7 @@ class FetchAtomService < BaseService
     elsif ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(response.mime_type)
       body = response.body_with_limit
       json = body_to_json(body)
-      if supported_context?(json) && ActivityPub::FetchRemoteAccountService::SUPPORTED_TYPES.include?(json['type']) && json['inbox'].present?
+      if supported_context?(json) && equals_or_includes_any?(json['type'], ActivityPub::FetchRemoteAccountService::SUPPORTED_TYPES) && json['inbox'].present?
         [json['id'], { prefetched_body: body, id: true }, :activitypub]
       elsif supported_context?(json) && expected_type?(json)
         [json['id'], { prefetched_body: body, id: true }, :activitypub]
@@ -62,7 +62,7 @@ class FetchAtomService < BaseService
   end
 
   def expected_type?(json)
-    (ActivityPub::Activity::Create::SUPPORTED_TYPES + ActivityPub::Activity::Create::CONVERTED_TYPES).include? json['type']
+    equals_or_includes_any?(json['type'], ActivityPub::Activity::Create::SUPPORTED_TYPES + ActivityPub::Activity::Create::CONVERTED_TYPES)
   end
 
   def process_html(response)