about summary refs log tree commit diff
path: root/app/policies/status_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/status_policy.rb')
-rw-r--r--app/policies/status_policy.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb
index 311ecf5ed..d5dad6350 100644
--- a/app/policies/status_policy.rb
+++ b/app/policies/status_policy.rb
@@ -19,7 +19,7 @@ class StatusPolicy < ApplicationPolicy
     if private?
       following_author? && still_accessible?
     else
-      author_allows_anon? && still_accessible? && !author_blocking? || following_author?
+      author_allows_anon? && still_accessible? && (!author_blocking? && !author_blocking_domain?) || following_author?
     end
   end
 
@@ -65,6 +65,12 @@ class StatusPolicy < ApplicationPolicy
     end
   end
 
+  def author_blocking_domain?
+    return false if current_account.nil? || current_account.domain.nil?
+
+    author.domain_blocking?(current_account.domain)
+  end
+
   def blocking_author?
     return false if current_account.nil?