Use default quote policy setting in the absence of API parameter (#36094)
This commit is contained in:
parent
38fa0102c1
commit
6c5a4702d9
1 changed files with 3 additions and 2 deletions
|
|
@ -4,8 +4,7 @@ module Api::InteractionPoliciesConcern
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
def quote_approval_policy
|
||||
# TODO: handle `nil` separately
|
||||
return nil unless Mastodon::Feature.outgoing_quotes_enabled? && status_params[:quote_approval_policy].present?
|
||||
return nil unless Mastodon::Feature.outgoing_quotes_enabled?
|
||||
|
||||
case status_params[:quote_approval_policy]
|
||||
when 'public'
|
||||
|
|
@ -14,6 +13,8 @@ module Api::InteractionPoliciesConcern
|
|||
Status::QUOTE_APPROVAL_POLICY_FLAGS[:followers] << 16
|
||||
when 'nobody'
|
||||
0
|
||||
when nil
|
||||
current_user.setting_default_quote_policy
|
||||
else
|
||||
# TODO: raise more useful message
|
||||
raise ActiveRecord::RecordInvalid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue