about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/models/status.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 791d96df1..edf805336 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -124,6 +124,7 @@ class Status < ApplicationRecord
   before_validation :set_reblog
   before_validation :set_visibility
   before_validation :set_conversation
+  before_validation :set_sensitivity
 
   class << self
     def not_in_filtered_languages(account)
@@ -250,6 +251,10 @@ class Status < ApplicationRecord
     self.visibility = (account.locked? ? :private : :public) if visibility.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