Change post sensitive is force false without media
This commit is contained in:
parent
1fc1d5fe3c
commit
507e00ccd0
1 changed files with 5 additions and 1 deletions
|
@ -65,7 +65,11 @@ class PostStatusService < BaseService
|
|||
private
|
||||
|
||||
def preprocess_attributes!
|
||||
@sensitive = (@options[:sensitive].nil? ? @account.user&.setting_default_sensitive : @options[:sensitive]) || @options[:spoiler_text].present?
|
||||
@sensitive = (if @options[:sensitive].nil?
|
||||
@media.any? ? @account.user&.setting_default_sensitive : false
|
||||
else
|
||||
@options[:sensitive]
|
||||
end) || @options[:spoiler_text].present?
|
||||
@text = @options.delete(:spoiler_text) if @text.blank? && @options[:spoiler_text].present?
|
||||
@visibility = @options[:visibility] || @account.user&.setting_default_privacy
|
||||
@visibility = :unlisted if (@visibility&.to_sym == :public || @visibility&.to_sym == :public_unlisted) && @account.silenced?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue