Fix to reject status quotations other than public and unlisted
This commit is contained in:
parent
24e85eda67
commit
8edd8ba895
1 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,7 @@ class Status < ApplicationRecord
|
|||
validates_with DisallowedHashtagsValidator
|
||||
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
|
||||
validates :visibility, exclusion: { in: %w(direct limited) }, if: :reblog?
|
||||
validates :quote_visibility, inclusion: { in: %w(public unlisted) }, if: :quote?
|
||||
|
||||
accepts_nested_attributes_for :poll
|
||||
|
||||
|
@ -176,6 +177,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 a new issue