Updated StatusPolicy to allow status viewing anytime status is owned by viewer
• Updated: - StatusPolicy to allow status viewing anytime status is owned by viewer
This commit is contained in:
parent
a5caa5e352
commit
3da162bf85
@ -65,18 +65,21 @@ class StatusPolicy < ApplicationPolicy
|
|||||||
|
|
||||||
def blocking_author?
|
def blocking_author?
|
||||||
return false if current_account.nil?
|
return false if current_account.nil?
|
||||||
|
return false if owned?
|
||||||
|
|
||||||
@preloaded_relations[:blocking] ? @preloaded_relations[:blocking][author.id] : current_account.blocking?(author)
|
@preloaded_relations[:blocking] ? @preloaded_relations[:blocking][author.id] : current_account.blocking?(author)
|
||||||
end
|
end
|
||||||
|
|
||||||
def author_blocking?
|
def author_blocking?
|
||||||
return false if current_account.nil?
|
return false if current_account.nil?
|
||||||
|
return false if owned?
|
||||||
|
|
||||||
@preloaded_relations[:blocked_by] ? @preloaded_relations[:blocked_by][author.id] : author.blocking?(current_account)
|
@preloaded_relations[:blocked_by] ? @preloaded_relations[:blocked_by][author.id] : author.blocking?(current_account)
|
||||||
end
|
end
|
||||||
|
|
||||||
def following_author?
|
def following_author?
|
||||||
return false if current_account.nil?
|
return false if current_account.nil?
|
||||||
|
return true if owned?
|
||||||
|
|
||||||
@preloaded_relations[:following] ? @preloaded_relations[:following][author.id] : current_account.following?(author)
|
@preloaded_relations[:following] ? @preloaded_relations[:following][author.id] : current_account.following?(author)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user