diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-08-22 00:49:56 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:19 -0500 |
commit | 6c3a1729e38264d811c1ccbe25a91b7c9b04ba9d (patch) | |
tree | 11c1187dbe2f8c68732bdd10fc9a22f3af235a99 /app/policies | |
parent | c299e9555426e36c4dbb489dcccad3ab6bad2f17 (diff) |
[Privacy] Use reply visibility gating to preserve thread permissions rather than public/private flag on thread
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/status_policy.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb index b92494103..9f851feb3 100644 --- a/app/policies/status_policy.rb +++ b/app/policies/status_policy.rb @@ -53,7 +53,7 @@ class StatusPolicy < ApplicationPolicy end def private? - visibility_for_remote_domain == 'private' || reply? && !public_conversation? + visibility_for_remote_domain == 'private' end def mention_exists? @@ -91,7 +91,7 @@ class StatusPolicy < ApplicationPolicy end def conversation_author_blocking? - return public_conversation? if conversation_owner.nil? + return false if conversation_owner.nil? @preloaded_relations[:blocked_by] ? @preloaded_relations[:blocked_by][conversation_owner.id] : conversation_owner.blocking?(current_account) end @@ -110,8 +110,7 @@ class StatusPolicy < ApplicationPolicy end def following_conversation_owner? - return false if current_account.nil? - return public_conversation? if conversation_owner.nil? + return false if current_account.nil? || conversation_owner.nil? @preloaded_relations[:following] ? @preloaded_relations[:following][conversation_owner.id] : current_account.following?(conversation_owner) end @@ -142,12 +141,6 @@ class StatusPolicy < ApplicationPolicy record.reply? && record.in_reply_to_account_id != author.id end - def public_conversation? - return @public_conversation if defined?(@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 |