mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Add default quote policy to API (#35948)
This commit is contained in:
parent
4ecbaea8bb
commit
8b7685d956
|
@ -48,6 +48,7 @@ class Api::V1::Accounts::CredentialsController < Api::BaseController
|
||||||
default_privacy: source_params.fetch(:privacy, @account.user.setting_default_privacy),
|
default_privacy: source_params.fetch(:privacy, @account.user.setting_default_privacy),
|
||||||
default_sensitive: source_params.fetch(:sensitive, @account.user.setting_default_sensitive),
|
default_sensitive: source_params.fetch(:sensitive, @account.user.setting_default_sensitive),
|
||||||
default_language: source_params.fetch(:language, @account.user.setting_default_language),
|
default_language: source_params.fetch(:language, @account.user.setting_default_language),
|
||||||
|
default_quote_policy: source_params.fetch(:quote_policy, @account.user.setting_default_quote_policy),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,6 +19,7 @@ class REST::CredentialAccountSerializer < REST::AccountSerializer
|
||||||
discoverable: object.discoverable,
|
discoverable: object.discoverable,
|
||||||
indexable: object.indexable,
|
indexable: object.indexable,
|
||||||
attribution_domains: object.attribution_domains,
|
attribution_domains: object.attribution_domains,
|
||||||
|
quote_policy: user.setting_default_quote_policy,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
|
||||||
attribute :posting_default_privacy, key: 'posting:default:visibility'
|
attribute :posting_default_privacy, key: 'posting:default:visibility'
|
||||||
attribute :posting_default_sensitive, key: 'posting:default:sensitive'
|
attribute :posting_default_sensitive, key: 'posting:default:sensitive'
|
||||||
attribute :posting_default_language, key: 'posting:default:language'
|
attribute :posting_default_language, key: 'posting:default:language'
|
||||||
|
attribute :posting_default_quote_policy, key: 'posting:default:quote_policy'
|
||||||
|
|
||||||
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
|
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
|
||||||
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
|
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
|
||||||
|
@ -13,6 +14,10 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
|
||||||
object.user.setting_default_privacy
|
object.user.setting_default_privacy
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def posting_default_quote_policy
|
||||||
|
object.user.setting_default_quote_policy
|
||||||
|
end
|
||||||
|
|
||||||
def posting_default_sensitive
|
def posting_default_sensitive
|
||||||
object.user.setting_default_sensitive
|
object.user.setting_default_sensitive
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user