about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-15 15:48:23 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:22 -0500
commitcec0a7ff3cb48a517d6863c56f7f932eb75d6dad (patch)
treeab3cf752c8406f88f04dfb89048001fcfecb5a4d /app
parent89ad628e887f2e7afa9b956c0fb52cfb31f6141b (diff)
Make sure that replies that are not sections of a root thread get filtered out of the world timeline.
Diffstat (limited to 'app')
-rw-r--r--app/services/fan_out_on_write_service.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 0dd1ec7ec..f2e0415cf 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -22,7 +22,7 @@ class FanOutOnWriteService < BaseService
     end
 
     return if status.reblog? && !Setting.show_reblogs_in_public_timelines
-    return if status.account.silenced?
+    return if filtered?(status)
 
     if !status.reblog? && status.distributable?
       deliver_to_hashtags(status)
@@ -31,18 +31,21 @@ class FanOutOnWriteService < BaseService
 
     if status.relayed?
       status = Status.find(status.reblog_of_id)
-      return if status.account.silenced?
+      return if filtered?(status)
       render_anonymous_payload(status)
     end
 
     return unless status.network? && status.public_visibility? && !status.reblog
-    return if status.reply? && status.in_reply_to_account_id != status.account_id && !Setting.show_replies_in_public_timelines
 
     deliver_to_local(status)
   end
 
   private
 
+  def filtered?(status)
+    status.account.silenced? || !Setting.show_replies_in_public_timelines && status.reply? && status.in_reply_to_account_id != status.account_id
+  end
+
   def deliver_to_self(status)
     Rails.logger.debug "Delivering status #{status.id} to author"
     FeedManager.instance.push_to_home(status.account, status)