mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Move "limited federation mode" config to x.mastodon area (#35041)
This commit is contained in:
parent
ed4788a342
commit
6f2aba989f
15 changed files with 30 additions and 30 deletions
|
|
@ -93,7 +93,7 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
activity_api_enabled: Setting.activity_api_enabled,
|
||||
admin: object.admin&.id&.to_s,
|
||||
domain: Addressable::IDNA.to_unicode(instance_presenter.domain),
|
||||
limited_federation_mode: Rails.configuration.x.limited_federation_mode,
|
||||
limited_federation_mode: Rails.configuration.x.mastodon.limited_federation_mode,
|
||||
locale: I18n.locale,
|
||||
mascot: instance_presenter.mascot&.file&.url,
|
||||
profile_directory: Setting.profile_directory,
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def limited_federation?
|
||||
Rails.configuration.x.limited_federation_mode
|
||||
Rails.configuration.x.mastodon.limited_federation_mode
|
||||
end
|
||||
|
||||
def markdown
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class WebfingerSerializer < ActiveModel::Serializer
|
|||
media_present = object.avatar.present? && object.avatar.content_type.present?
|
||||
|
||||
# Show avatar only if an instance shows profiles to logged out users
|
||||
allowed_by_config = ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] != 'true' && !Rails.configuration.x.limited_federation_mode
|
||||
allowed_by_config = ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] != 'true' && !Rails.configuration.x.mastodon.limited_federation_mode
|
||||
|
||||
media_present && allowed_by_config
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue