diff --git a/app/models/status.rb b/app/models/status.rb index e84bff3d60..c08f0c55cd 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -89,6 +89,7 @@ class Status < ApplicationRecord validates :reblog, uniqueness: { scope: :account }, if: :reblog? validates :visibility, exclusion: { in: %w(direct limited) }, if: :reblog? validates :content_type, inclusion: { in: %w(text/plain text/markdown text/html) }, allow_nil: true + validates :quote_visibility, inclusion: { in: %w(public unlisted) }, if: :quote? accepts_nested_attributes_for :poll @@ -213,6 +214,10 @@ class Status < ApplicationRecord !quote_id.nil? && quote end + def quote_visibility + quote&.visibility + end + def within_realtime_window? created_at >= REAL_TIME_WINDOW.ago end