mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Handle Update of a FeaturedCollection (#38337)
This commit is contained in:
@@ -13,6 +13,8 @@ class ActivityPub::Activity::Update < ActivityPub::Activity
|
||||
update_account
|
||||
elsif supported_object_type? || converted_object_type?
|
||||
update_status
|
||||
elsif equals_or_includes_any?(@object['type'], ['FeaturedCollection']) && Mastodon::Feature.collections_federation_enabled?
|
||||
update_collection
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,6 +43,12 @@ class ActivityPub::Activity::Update < ActivityPub::Activity
|
||||
ActivityPub::ProcessStatusUpdateService.new.call(@status, @json, @object, request_id: @options[:request_id])
|
||||
end
|
||||
|
||||
def update_collection
|
||||
return reject_payload! if non_matching_uri_hosts?(@account.uri, object_uri)
|
||||
|
||||
ActivityPub::ProcessFeaturedCollectionService.new.call(@account, @object)
|
||||
end
|
||||
|
||||
def object_too_old?
|
||||
@object['published'].present? && @object['published'].to_datetime < OBJECT_AGE_THRESHOLD.ago
|
||||
rescue Date::Error
|
||||
|
||||
Reference in New Issue
Block a user