Fix handling of inlined featured collections in ActivityPub actor objects (#34789)

This commit is contained in:
Claire 2025-05-23 17:01:07 +02:00 committed by GitHub
parent 3bf128e62a
commit 304c0417ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 79 additions and 32 deletions

View file

@ -4,13 +4,11 @@ class ActivityPub::FetchFeaturedCollectionService < BaseService
include JsonLdHelper
def call(account, **options)
return if account.featured_collection_url.blank? || account.suspended? || account.local?
return if (account.featured_collection_url.blank? && options[:collection].blank?) || account.suspended? || account.local?
@account = account
@options = options
@json = fetch_resource(@account.featured_collection_url, true, local_follower)
return unless supported_context?(@json)
@json = fetch_collection(options[:collection].presence || @account.featured_collection_url)
process_items(collection_items(@json))
end