diff options
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/status_policy.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb index bec58c39f..69d18c4bf 100644 --- a/app/policies/status_policy.rb +++ b/app/policies/status_policy.rb @@ -45,7 +45,7 @@ class StatusPolicy < ApplicationPolicy private def requires_mention? - record.direct_visibility? || record.limited_visibility? + %w(direct limited).include?(visibility_for_remote_domain) end def owned? @@ -53,7 +53,7 @@ class StatusPolicy < ApplicationPolicy end def private? - record.private_visibility? || !public_conversation? + visibility_for_remote_domain == 'private' || !public_conversation? end def mention_exists? @@ -164,4 +164,8 @@ class StatusPolicy < ApplicationPolicy def public_conversation? @public_conversation ||= (record.conversation&.public? || false) end + + def visibility_for_remote_domain + @visibility_for_domain ||= record.visibility_for_domain(current_account&.domain) + end end |