When creating status, if no sensitive status is given, use default (#7057)

Clients using the API that do not provide the sensitive flag are always
posting with false sensitive option.
rebase/4.0.0rc2
Renato "Lond" Cerqueira 2018-04-09 23:02:42 +02:00 committed by Eugen Rochko
parent 904a2479dd
commit 0c52654b52
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class PostStatusService < BaseService
status = account.statuses.create!(text: text, status = account.statuses.create!(text: text,
media_attachments: media || [], media_attachments: media || [],
thread: in_reply_to, thread: in_reply_to,
sensitive: options[:sensitive], sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]),
spoiler_text: options[:spoiler_text] || '', spoiler_text: options[:spoiler_text] || '',
visibility: options[:visibility] || account.user&.setting_default_privacy, visibility: options[:visibility] || account.user&.setting_default_privacy,
language: LanguageDetector.instance.detect(text, account), language: LanguageDetector.instance.detect(text, account),