mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Handle Add activity to featuredCollections (#38167)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user