diff options
author | Renato "Lond" Cerqueira <renato@lond.com.br> | 2018-04-09 23:02:42 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-04-09 23:02:42 +0200 |
commit | 0c52654b5275fd0e7a0b544d3c6f895825e4a266 (patch) | |
tree | 5dd6e9289028233f03857282427bf5626189914d | |
parent | 904a2479dd2085dfc94f33746ad6f7a755e72609 (diff) |
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.
-rw-r--r-- | app/services/post_status_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index c91192181..9d2c7a4dc 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -28,7 +28,7 @@ class PostStatusService < BaseService 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), |