about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-07-14 22:31:38 +0200
committerGitHub <noreply@github.com>2017-07-14 22:31:38 +0200
commitde397f3bc1f1c7e632d0db0754711beb6ce04664 (patch)
tree75f83180dda98eb28f0bd383232ba4303deb9db3 /app/lib
parent72bd73f605a7253daf445f76425da3182a1f669c (diff)
Fix subsequent replies to unresolved status not being filtered from home (#4190)
Resolves #4177 - smaller changeset
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/feed_manager.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index c507f2636..b1ae11084 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -93,7 +93,7 @@ class FeedManager
   end
 
   def filter_from_home?(status, receiver_id)
-    return true if status.reply? && status.in_reply_to_id.nil?
+    return true if status.reply? && (status.in_reply_to_id.nil? || status.in_reply_to_account_id.nil?)
 
     check_for_mutes = [status.account_id]
     check_for_mutes.concat([status.reblog.account_id]) if status.reblog?
@@ -120,12 +120,13 @@ class FeedManager
   end
 
   def filter_from_mentions?(status, receiver_id)
+    return true if receiver_id == status.account_id
+
     check_for_blocks = [status.account_id]
     check_for_blocks.concat(status.mentions.pluck(:account_id))
     check_for_blocks.concat([status.in_reply_to_account]) if status.reply? && !status.in_reply_to_account_id.nil?
 
-    should_filter   = receiver_id == status.account_id                                                                                   # Filter if I'm mentioning myself
-    should_filter ||= Block.where(account_id: receiver_id, target_account_id: check_for_blocks).any?                                     # or it's from someone I blocked, in reply to someone I blocked, or mentioning someone I blocked
+    should_filter   = Block.where(account_id: receiver_id, target_account_id: check_for_blocks).any?                                     # Filter if it's from someone I blocked, in reply to someone I blocked, or mentioning someone I blocked
     should_filter ||= (status.account.silenced? && !Follow.where(account_id: receiver_id, target_account_id: status.account_id).exists?) # of if the account is silenced and I'm not following them
 
     should_filter