2
0

Add quote_approval_policy parameter when posting and editing statuses (#35699)

This commit is contained in:
Claire
2025-08-06 16:23:12 +02:00
committed by GitHub
parent 6e48322055
commit 9ec99ffef1
5 changed files with 70 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ class PostStatusService < BaseService
# @option [String] :text Message
# @option [Status] :thread Optional status to reply to
# @option [Status] :quoted_status Optional status to quote
# @option [String] :quote_approval_policy Approval policy for quotes, one of `public`, `followers` or `nobody`
# @option [Boolean] :sensitive
# @option [String] :visibility
# @option [String] :spoiler_text
@@ -215,6 +216,7 @@ class PostStatusService < BaseService
language: valid_locale_cascade(@options[:language], @account.user&.preferred_posting_language, I18n.default_locale),
application: @options[:application],
rate_limit: @options[:with_rate_limit],
quote_approval_policy: @options[:quote_approval_policy],
}.compact
end

View File

@@ -115,6 +115,7 @@ class UpdateStatusService < BaseService
@status.spoiler_text = @options[:spoiler_text] || '' if @options.key?(:spoiler_text)
@status.sensitive = @options[:sensitive] || @options[:spoiler_text].present? if @options.key?(:sensitive) || @options.key?(:spoiler_text)
@status.language = valid_locale_cascade(@options[:language], @status.language, @status.account.user&.preferred_posting_language, I18n.default_locale)
@status.quote_approval_policy = @options[:quote_approval_policy] if @options[:quote_approval_policy].present?
# We raise here to rollback the entire transaction
raise NoChangesSubmittedError unless significant_changes?