mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Federate new profile settings (#38314)
This commit is contained in:
@@ -25,6 +25,12 @@ module ContextHelper
|
||||
voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' },
|
||||
suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' },
|
||||
attribution_domains: { 'toot' => 'http://joinmastodon.org/ns#', 'attributionDomains' => { '@id' => 'toot:attributionDomains', '@type' => '@id' } },
|
||||
profile_settings: {
|
||||
'toot' => 'http://joinmastodon.org/ns#',
|
||||
'showFeatured' => 'toot:showFeatured',
|
||||
'showMedia' => 'toot:showMedia',
|
||||
'showRepliesInMedia' => 'toot:showRepliesInMedia',
|
||||
},
|
||||
quote_requests: { 'QuoteRequest' => 'https://w3id.org/fep/044f#QuoteRequest' },
|
||||
quotes: {
|
||||
'quote' => 'https://w3id.org/fep/044f#quote',
|
||||
|
||||
@@ -8,7 +8,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
||||
|
||||
context_extensions :manually_approves_followers, :featured, :also_known_as,
|
||||
:moved_to, :property_value, :discoverable, :suspended,
|
||||
:memorial, :indexable, :attribution_domains
|
||||
:memorial, :indexable, :attribution_domains, :profile_settings
|
||||
|
||||
context_extensions :interaction_policies if Mastodon::Feature.collections_enabled?
|
||||
|
||||
@@ -16,7 +16,10 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
||||
:inbox, :outbox, :featured, :featured_tags,
|
||||
:preferred_username, :name, :summary,
|
||||
:url, :manually_approves_followers,
|
||||
:discoverable, :indexable, :published, :memorial
|
||||
:discoverable, :indexable, :published, :memorial,
|
||||
:show_featured, :show_media
|
||||
|
||||
attribute :show_media_replies, key: :show_replies_in_media
|
||||
|
||||
attribute :interaction_policy, if: -> { Mastodon::Feature.collections_enabled? }
|
||||
attribute :featured_collections, if: -> { Mastodon::Feature.collections_enabled? }
|
||||
|
||||
@@ -135,6 +135,9 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||
@account.discoverable = @json['discoverable'] || false
|
||||
@account.indexable = @json['indexable'] || false
|
||||
@account.memorial = @json['memorial'] || false
|
||||
@account.show_featured = @json['showFeatured'] if @json.key?('showFeatured')
|
||||
@account.show_media = @json['showMedia'] if @json.key?('showMedia')
|
||||
@account.show_media_replies = @json['showRepliesInMedia'] if @json.key?('showRepliesInMedia')
|
||||
@account.attribution_domains = as_array(@json['attributionDomains'] || []).take(Account::ATTRIBUTION_DOMAINS_HARD_LIMIT).map { |item| value_or_id(item) }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user