about summary refs log tree commit diff
path: root/app/lib/feed_manager.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-21 23:40:01 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:44:01 -0500
commitc752a46c457759149c14ae0e4d501d5ef2ce478a (patch)
tree5066a3b5cf73ba06d16a8b494bc3e91a094f807b /app/lib/feed_manager.rb
parent03338243d28df8ecca77785c77214260ca0c32c9 (diff)
[Privacy] Implement thread ownership and visibility
Diffstat (limited to 'app/lib/feed_manager.rb')
-rw-r--r--app/lib/feed_manager.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index 92c125c0f..49db68119 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -56,6 +56,7 @@ class FeedManager
       should_filter &&= status.account_id == list.account_id
       should_filter &&= !list.show_all_replies?
       should_filter &&= !(list.show_list_replies? && ListAccount.where(list_id: list.id, account_id: status.in_reply_to_account_id).exists?)
+      should_filter &&= !(list.show_list_replies? && status.conversation&.account_id.present? && ListAccount.where(list_id: list.id, account_id: status.conversation.account_id).exists?)
       return false if should_filter
     end
 
@@ -248,11 +249,13 @@ class FeedManager
 
     check_for_blocks = crutches[:active_mentions][status.id] || []
     check_for_blocks.concat([status.account_id])
+    check_for_blocks.concat([status.conversation.account_id]) unless status.conversation&.account_id.nil?
     check_for_blocks.concat([[status.in_reply_to_account_id]]) if status.reply?
 
     if status.reblog?
       check_for_blocks.concat([status.reblog.account_id])
       check_for_blocks.concat(crutches[:active_mentions][status.reblog_of_id] || [])
+      check_for_blocks.concat([status.reblog.conversation.account_id]) unless status.reblog.conversation&.account_id.nil?
       check_for_blocks.concat([[status.reblog.in_reply_to_account_id]]) if status.reblog.reply?
     end
 
@@ -260,6 +263,7 @@ class FeedManager
 
     if status.reply? && !status.in_reply_to_account_id.nil?                                                                      # Filter out if it's a reply
       should_filter   = !crutches[:following][status.in_reply_to_account_id]                                                     # and I'm not following the person it's a reply to
+      should_filter &&= !crutches[:following][status.conversation&.account_id]                                                   # and I'm not following the thread owner
       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