Handle Add activity to featuredCollections (#38167)

This commit is contained in:
David Roetzel
2026-03-12 11:14:22 +01:00
committed by GitHub
parent 7f9df6d02d
commit 94aa5d7c9e
2 changed files with 50 additions and 0 deletions

View File

@@ -12,6 +12,10 @@ class ActivityPub::Activity::Add < ActivityPub::Activity
else
add_featured
end
when @account.collections_url
return unless Mastodon::Feature.collections_federation_enabled?
add_collection
else
@collection = @account.collections.find_by(uri: @json['target'])
add_collection_item if @collection && Mastodon::Feature.collections_federation_enabled?
@@ -34,6 +38,10 @@ class ActivityPub::Activity::Add < ActivityPub::Activity
FeaturedTag.create!(account: @account, name: name) if name.present?
end
def add_collection
ActivityPub::ProcessFeaturedCollectionService.new.call(@account, @object)
end
def add_collection_item
ActivityPub::ProcessFeaturedItemService.new.call(@collection, @object)
end