Fix search policy
This commit is contained in:
parent
5e8bdaaab6
commit
fdf3b93c36
1 changed files with 13 additions and 1 deletions
|
@ -20,7 +20,15 @@ class StatusPolicy < ApplicationPolicy
|
||||||
end
|
end
|
||||||
|
|
||||||
def search?
|
def search?
|
||||||
show? && (record.public_visibility? || record.public_unlisted_visibility?)
|
return false if author.suspended?
|
||||||
|
|
||||||
|
if requires_mention?
|
||||||
|
owned? || mention_exists?
|
||||||
|
elsif !public?
|
||||||
|
owned? || following_author? || mention_exists?
|
||||||
|
else
|
||||||
|
current_account.nil? || (!author_blocking? && !author_blocking_domain?)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def reblog?
|
def reblog?
|
||||||
|
@ -59,6 +67,10 @@ class StatusPolicy < ApplicationPolicy
|
||||||
record.private_visibility?
|
record.private_visibility?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def public?
|
||||||
|
record.public_visibility? || record.public_unlisted_visibility?
|
||||||
|
end
|
||||||
|
|
||||||
def mention_exists?
|
def mention_exists?
|
||||||
return false if current_account.nil?
|
return false if current_account.nil?
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue