Skip to content

Commit

Permalink
When creating status, if no sensitive status is given, use default (#…
Browse files Browse the repository at this point in the history
…7057)

Clients using the API that do not provide the sensitive flag are always
posting with false sensitive option.
  • Loading branch information
renatolond authored and Gargron committed Apr 9, 2018
1 parent 904a247 commit 0c52654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/post_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def call(account, text, in_reply_to = nil, **options)
status = account.statuses.create!(text: text,
media_attachments: media || [],
thread: in_reply_to,
sensitive: options[:sensitive],
sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]),
spoiler_text: options[:spoiler_text] || '',
visibility: options[:visibility] || account.user&.setting_default_privacy,
language: LanguageDetector.instance.detect(text, account),
Expand Down

0 comments on commit 0c52654

Please sign in to comment.