about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/models/status.rb5
-rw-r--r--app/services/post_status_service.rb2
2 files changed, 1 insertions, 6 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 08ec36f38..b256069f7 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -187,7 +187,6 @@ class Status < ApplicationRecord
   before_validation :set_reblog
   before_validation :set_visibility
   before_validation :set_conversation
-  before_validation :set_sensitivity
   before_validation :set_local
 
   class << self
@@ -368,10 +367,6 @@ class Status < ApplicationRecord
     self.sensitive  = false if sensitive.nil?
   end
 
-  def set_sensitivity
-    self.sensitive = sensitive || spoiler_text.present?
-  end
-
   def set_conversation
     self.reply = !(in_reply_to_id.nil? && thread.nil?) unless reply
 
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 7a3576e2d..d072e581d 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].nil? ? account.user&.setting_default_sensitive : options[:sensitive]),
+                                        sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]) || options[:spoiler_text].present?,
                                         spoiler_text: options[:spoiler_text] || '',
                                         visibility: options[:visibility] || account.user&.setting_default_privacy,
                                         language: language_from_option(options[:language]) || LanguageDetector.instance.detect(text, account),