th: status: disallow quoting of non-public posts
parent
4681e0c00e
commit
104cf929a5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue