about summary refs log tree commit diff
path: root/app/services/fan_out_on_write_service.rb
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-14 15:22:55 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:21 -0500
commit2db51e2f4cc55c520634df8ca34b58742ded0153 (patch)
tree8236f6a359d6d501228cf60c725289c252445e27 /app/services/fan_out_on_write_service.rb
parentc86c4b95bee3a51ea7a0d11f0a26b50202853dde (diff)
Refactored community-curated world timeline code; **privacy**: remove support for packmate-visible hashtags until we resolve federation caveats.
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r--app/services/fan_out_on_write_service.rb23
1 files changed, 9 insertions, 14 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index a81482dd6..0dd1ec7ec 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -3,7 +3,7 @@
 class FanOutOnWriteService < BaseService
   # Push a status into home and mentions feeds
   # @param [Status] status
-  def call(status, allow_nonlocal = false, deliver_to_local = true)
+  def call(status)
     raise Mastodon::RaceConditionError if status.visibility.nil?
 
     deliver_to_self(status) if status.account.local?
@@ -24,25 +24,21 @@ class FanOutOnWriteService < BaseService
     return if status.reblog? && !Setting.show_reblogs_in_public_timelines
     return if status.account.silenced?
 
-    deliver_to_hashtags(status) if !status.reblog? && status.distributable?
-
-    # we want to let community users decide what goes on the ftl with boosts
-    return unless allow_nonlocal || status.network? || status.relayed?
+    if !status.reblog? && status.distributable?
+      deliver_to_hashtags(status)
+      deliver_to_public(status) if status.curated
+    end
 
-    if status.reblog? then
+    if status.relayed?
       status = Status.find(status.reblog_of_id)
+      return if status.account.silenced?
       render_anonymous_payload(status)
-      deliver_to_local = status.network?
     end
 
-    return if status.account.silenced? || !status.public_visibility?
+    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
 
-    if deliver_to_local then
-      deliver_to_local(status)
-    else
-      deliver_to_public(status)
-    end
+    deliver_to_local(status)
   end
 
   private
@@ -104,7 +100,6 @@ class FanOutOnWriteService < BaseService
   def deliver_to_local(status)
     Rails.logger.debug "Delivering status #{status.id} to local timeline"
 
-    return unless status.network?
     Redis.current.publish('timeline:public:local', @payload)
     Redis.current.publish('timeline:public:local:media', @payload) if status.media_attachments.any?
   end