Skip to content

Commit

Permalink
Fix: Status policy
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 committed Dec 30, 2022
1 parent 509e57f commit a4222d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/lib/status_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(status, account, preloaded_relations = {})

def filtered?
return false if !account.nil? && account.id == status.account_id
(account_present? && filtered_status?) || silenced_account?
blocked_by_policy? || (account_present? && filtered_status?) || silenced_account?
end

private
Expand Down Expand Up @@ -48,6 +48,10 @@ def account_following_status_account?
@preloaded_relations[:following] ? @preloaded_relations[:following][status.account_id] : account&.following?(status.account_id)
end

def blocked_by_policy?
!policy_allows_show?
end

def policy_allows_show?
StatusPolicy.new(account, status, @preloaded_relations).show?
end
Expand Down

0 comments on commit a4222d4

Please sign in to comment.