Merge pull request #1229 from hometown-fork/1219-expose-local-only-default-on-api

Expose the "default_federation" preference on the preferences API
This commit is contained in:
Darius Kazemi 2022-12-01 21:28:46 -08:00 committed by GitHub
commit f9c2070d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
attribute :posting_default_privacy, key: 'posting:default:visibility'
attribute :posting_default_sensitive, key: 'posting:default:sensitive'
attribute :posting_default_language, key: 'posting:default:language'
attribute :posting_default_federation, key: 'posting:default:federation'
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
@ -27,4 +28,8 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
def reading_default_sensitive_text
object.user.setting_expand_spoilers
end
def posting_default_federation
object.user.setting_default_federation
end
end

View File

@ -157,7 +157,7 @@ en:
setting_auto_play_gif: Auto-play animated GIFs
setting_boost_modal: Show confirmation dialog before boosting
setting_crop_images: Crop images in non-expanded posts to 16x9
setting_default_federation: Allow my posts to reach other instances by default
setting_default_federation: Allow my posts to reach other servers by default
setting_default_language: Posting language
setting_default_privacy: Posting privacy
setting_default_sensitive: Always mark media as sensitive