@ -48,6 +48,7 @@ class PostStatusService < BaseService
private
private
def preprocess_attributes!
def preprocess_attributes!
@sensitive = ( @options [ :sensitive ] . nil? ? @account . user & . setting_default_sensitive : @options [ :sensitive ] ) || @options [ :spoiler_text ] . present?
@text = @options . delete ( :spoiler_text ) if @text . blank? && @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 = @options [ :visibility ] || @account . user & . setting_default_privacy
@visibility = :unlisted if @visibility & . to_sym == :public && @account . silenced?
@visibility = :unlisted if @visibility & . to_sym == :public && @account . silenced?
@ -157,7 +158,7 @@ class PostStatusService < BaseService
media_attachments : @media || [ ] ,
media_attachments : @media || [ ] ,
thread : @in_reply_to ,
thread : @in_reply_to ,
poll_attributes : poll_attributes ,
poll_attributes : poll_attributes ,
sensitive : ( @options [ :sensitive ] . nil? ? @account . user & . setting_default_ sensitive : @options [ :sensitive ] ) || @options [ :spoiler_text ] . present? ,
sensitive : @sensitive ,
spoiler_text : @options [ :spoiler_text ] || '' ,
spoiler_text : @options [ :spoiler_text ] || '' ,
visibility : @visibility ,
visibility : @visibility ,
language : language_from_option ( @options [ :language ] ) || @account . user & . setting_default_language & . presence || LanguageDetector . instance . detect ( @text , @account ) ,
language : language_from_option ( @options [ :language ] ) || @account . user & . setting_default_language & . presence || LanguageDetector . instance . detect ( @text , @account ) ,