about summary refs log tree commit diff
path: root/app/lib/feed_manager.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-09 20:25:39 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-09 20:25:39 +0100
commit6331ed16e5953e3a006896c6df07b0f82cfd2350 (patch)
treeb1b03e90ccb2feddc65aaf689808658381118228 /app/lib/feed_manager.rb
parentc424df5192f346dba5332a4b3a2de43b2f028e0c (diff)
Fix #614 - extra reply-boolean on statuses to account for cases when replied-to
status is not in the system at time of distribution; fix #607 - reset privacy
settings to defaults when cancelling replies
Diffstat (limited to 'app/lib/feed_manager.rb')
-rw-r--r--app/lib/feed_manager.rb19
1 files changed, 3 insertions, 16 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index 7069026e3..f0928a945 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -16,8 +16,6 @@ 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
@@ -89,7 +87,9 @@ class FeedManager
   def filter_from_home?(status, receiver)
     should_filter = false
 
-    if status.reply? && !status.in_reply_to_account_id.nil?                   # Filter out if it's a reply
+    if status.reply? && status.in_reply_to_id.nil?
+      should_filter = true
+    elsif status.reply? && !status.in_reply_to_account_id.nil?                # Filter out if it's a reply
       should_filter   = !receiver.following?(status.in_reply_to_account)      # and I'm not following the person it's a reply to
       should_filter &&= !(receiver.id == status.in_reply_to_account_id)       # and it's not a reply to me
       should_filter &&= !(status.account_id == status.in_reply_to_account_id) # and it's not a self-reply
@@ -115,17 +115,4 @@ class FeedManager
 
     should_filter
   end
-
-  def filter_from_public?(status, receiver)
-    should_filter   = receiver.blocking?(status.account)
-    should_filter ||= receiver.blocking?(status.mentions.includes(:account).map(&:account))
-
-    if status.reply? && !status.in_reply_to_account_id.nil?
-      should_filter ||= receiver.blocking?(status.in_reply_to_account)
-    elsif status.reblog?
-      should_filter ||= receiver.blocking?(status.reblog.account)
-    end
-
-    should_filter
-  end
 end