From 6331ed16e5953e3a006896c6df07b0f82cfd2350 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 9 Feb 2017 20:25:39 +0100 Subject: 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 --- app/lib/feed_manager.rb | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'app/lib/feed_manager.rb') 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 -- cgit