about summary refs log tree commit diff
path: root/app/policies/status_policy.rb
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-10-09 09:56:17 -0400
committerGitHub <noreply@github.com>2017-10-09 09:56:17 -0400
commitf0a2a6c875e9294f0ea1d4c6bc90529e41a2dc37 (patch)
treebe9174c3c262f38376b7c49b26495bd17e19e61b /app/policies/status_policy.rb
parent92a3181dc685aa4b3736b56f8a5d1c4d85b99544 (diff)
try to tighten up local only toot stuff, like... properly (#163)
* try to tighten up local only toot stuff, like... properly

* try to un-break tests
Diffstat (limited to 'app/policies/status_policy.rb')
-rw-r--r--app/policies/status_policy.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb
index 2ded61850..f4a5e7c6c 100644
--- a/app/policies/status_policy.rb
+++ b/app/policies/status_policy.rb
@@ -9,6 +9,8 @@ class StatusPolicy
   end
 
   def show?
+    return false if local_only? && account.nil?
+
     if direct?
       owned? || status.mentions.where(account: account).exists?
     elsif private?
@@ -45,4 +47,8 @@ class StatusPolicy
   def private?
     status.private_visibility?
   end
+  
+  def local_only?
+    status.local_only?
+  end
 end