Skip to content
Snippets Groups Projects
Commit e48d3bfd authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix #1010 - When spoiler text is set, enforce sensitivity too (#4176)

parent 5abb3d81
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment