about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/feed_manager.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index af7b2380e..fe88c0fb9 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -14,6 +14,8 @@ class FeedManager
       filter_from_home?(status, receiver)
     elsif timeline_type == :mentions
       filter_from_mentions?(status, receiver)
+    elsif timeline_type == :public
+      filter_from_public?(status, receiver)
     else
       false
     end
@@ -80,4 +82,16 @@ class FeedManager
     should_filter = should_filter || receiver.blocking?(status.account) # or it's from someone I blocked
     should_filter
   end
+
+  def filter_from_public?(status, receiver)
+    should_filter = receiver.blocking?(status.account)
+
+    if status.reply? && !status.thread.account.nil?
+      should_filter = should_filter || receiver.blocking?(status.thread.account)
+    elsif status.reblog?
+      should_filter = should_filter || receiver.blocking?(status.reblog.account)
+    end
+
+    should_filter
+  end
 end