Add missing FeaturedCollection vocabulary to contexts (#39251)

This commit is contained in:
David Roetzel 2026-06-03 15:56:38 +02:00 committed by GitHub
parent 4cbea7f5a4
commit 8b18195075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 0 deletions

View File

@ -42,6 +42,7 @@ module ContextHelper
interaction_policies: {
'gts' => 'https://gotosocial.org/ns#',
'interactionPolicy' => { '@id' => 'gts:interactionPolicy', '@type' => '@id' },
'canFeature' => { '@id' => 'https://w3id.org/fep/7aa9#canFeature', '@type' => '@id' },
'canQuote' => { '@id' => 'gts:canQuote', '@type' => '@id' },
'automaticApproval' => { '@id' => 'gts:automaticApproval', '@type' => '@id' },
'manualApproval' => { '@id' => 'gts:manualApproval', '@type' => '@id' },
@ -52,6 +53,22 @@ module ContextHelper
'interactingObject' => { '@id' => 'gts:interactingObject', '@type' => '@id' },
'interactionTarget' => { '@id' => 'gts:interactionTarget', '@type' => '@id' },
},
feature_requests: { 'FeatureRequest' => 'https://w3id.org/fep/7aa9#FeatureRequest' },
featured_collections: {
'FeaturedCollection' => 'https://w3id.org/fep/7aa9#FeaturedCollection',
'FeaturedItem' => 'https://w3id.org/fep/7aa9#FeaturedItem',
'FeatureRequest' => 'https://w3id.org/fep/7aa9#FeatureRequest',
'FeatureAuthorization' => 'https://w3id.org/fep/7aa9#FeatureAuthorization',
'topic' => { '@id' => 'https://w3id.org/fep/7aa9#topic', '@type' => '@id' },
'featuredObject' => { '@id' => 'https://w3id.org/fep/7aa9#featuredObject', '@type' => '@id' },
'featureAuthorization' => { '@id' => 'https://w3id.org/fep/7aa9#featureAuthorization', '@type' => '@id' },
},
feature_authorizations: {
'gts' => 'https://gotosocial.org/ns#',
'FeatureAuthorization' => 'https://w3id.org/fep/7aa9#FeatureAuthorization',
'interactingObject' => { '@id' => 'gts:interactingObject', '@type' => '@id' },
'interactionTarget' => { '@id' => 'gts:interactionTarget', '@type' => '@id' },
},
}.freeze
def full_context

View File

@ -3,6 +3,8 @@
class ActivityPub::FeatureAuthorizationSerializer < ActivityPub::Serializer
include RoutingHelper
context_extensions :feature_authorizations
attributes :id, :type, :interacting_object, :interaction_target
def id

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ActivityPub::FeatureRequestSerializer < ActivityPub::Serializer
context_extensions :feature_requests
attributes :id, :type, :instrument
attribute :virtual_object, key: :object

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ActivityPub::FeaturedCollectionSerializer < ActivityPub::Serializer
context_extensions :discoverable, :featured_collections, :hashtag, :sensitive
attributes :id, :type, :total_items, :name, :attributed_to, :url,
:sensitive, :discoverable, :published, :updated

View File

@ -3,6 +3,8 @@
class ActivityPub::FeaturedItemSerializer < ActivityPub::Serializer
include RoutingHelper
context_extensions :featured_collections
attributes :id, :type, :featured_object, :feature_authorization, :published
def id