Use default quote policy setting in the absence of API parameter (#36094)
This commit is contained in:
@@ -4,8 +4,7 @@ module Api::InteractionPoliciesConcern
|
|||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def quote_approval_policy
|
def quote_approval_policy
|
||||||
# TODO: handle `nil` separately
|
return nil unless Mastodon::Feature.outgoing_quotes_enabled?
|
||||||
return nil unless Mastodon::Feature.outgoing_quotes_enabled? && status_params[:quote_approval_policy].present?
|
|
||||||
|
|
||||||
case status_params[:quote_approval_policy]
|
case status_params[:quote_approval_policy]
|
||||||
when 'public'
|
when 'public'
|
||||||
@@ -14,6 +13,8 @@ module Api::InteractionPoliciesConcern
|
|||||||
Status::QUOTE_APPROVAL_POLICY_FLAGS[:followers] << 16
|
Status::QUOTE_APPROVAL_POLICY_FLAGS[:followers] << 16
|
||||||
when 'nobody'
|
when 'nobody'
|
||||||
0
|
0
|
||||||
|
when nil
|
||||||
|
current_user.setting_default_quote_policy
|
||||||
else
|
else
|
||||||
# TODO: raise more useful message
|
# TODO: raise more useful message
|
||||||
raise ActiveRecord::RecordInvalid
|
raise ActiveRecord::RecordInvalid
|
||||||
|
|||||||
Reference in New Issue
Block a user