diff options
author | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-03-30 19:17:17 +0000 |
---|---|---|
committer | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-03-30 19:17:17 +0000 |
commit | f0bb3ff53307aac7b9c64ec8a48d4ba1d2019513 (patch) | |
tree | 42a5d4f630f5afe0c2aee7e53fbdbe5751cb1fb6 /app/services | |
parent | 01bad04efd09ede8c31c578259468be329e4fc3c (diff) | |
parent | e573bb0990ece4b1a521ccf8a4c7bec5972d3538 (diff) |
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/fetch_atom_service.rb | 6 | ||||
-rw-r--r-- | app/services/resolve_url_service.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/services/fetch_atom_service.rb b/app/services/fetch_atom_service.rb index 62dea8298..87076cc07 100644 --- a/app/services/fetch_atom_service.rb +++ b/app/services/fetch_atom_service.rb @@ -44,7 +44,7 @@ class FetchAtomService < BaseService json = body_to_json(body) if supported_context?(json) && json['type'] == 'Person' && json['inbox'].present? [json['id'], { prefetched_body: body, id: true }, :activitypub] - elsif supported_context?(json) && json['type'] == 'Note' + elsif supported_context?(json) && expected_type?(json) [json['id'], { prefetched_body: body, id: true }, :activitypub] else @unsupported_activity = true @@ -61,6 +61,10 @@ class FetchAtomService < BaseService end end + def expected_type?(json) + (ActivityPub::Activity::Create::SUPPORTED_TYPES + ActivityPub::Activity::Create::CONVERTED_TYPES).include? json['type'] + end + def process_html(response) page = Nokogiri::HTML(response.body_with_limit) diff --git a/app/services/resolve_url_service.rb b/app/services/resolve_url_service.rb index 1f2b24524..9499dc286 100644 --- a/app/services/resolve_url_service.rb +++ b/app/services/resolve_url_service.rb @@ -19,7 +19,7 @@ class ResolveURLService < BaseService case type when 'Person' FetchRemoteAccountService.new.call(atom_url, body, protocol) - when 'Note' + when 'Note', 'Article', 'Image', 'Video' FetchRemoteStatusService.new.call(atom_url, body, protocol) end end |