Mastodon/app/serializers/activitypub/featured_item_serializer.rb
2026-02-12 15:31:45 +00:00

22 lines
440 B
Ruby

# frozen_string_literal: true
class ActivityPub::FeaturedItemSerializer < ActivityPub::Serializer
attributes :id, :type, :featured_object, :featured_object_type
def id
ActivityPub::TagManager.instance.uri_for(object)
end
def type
'FeaturedItem'
end
def featured_object
ActivityPub::TagManager.instance.uri_for(object.account)
end
def featured_object_type
object.account.actor_type || 'Person'
end
end