diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-12-05 13:09:26 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-12-05 13:09:26 -0600 |
commit | 996cb6818f30b2749f510cda91c637d506ca8fe1 (patch) | |
tree | 9dba6cbc7d1e80b20fb4a2ad5f7358a41c7ff4ad /app | |
parent | 04d55aab4af9b05b2a55b224aff1ed4c423837f3 (diff) |
avoid resurfacing old posts that are being streamed into the world timeline
Diffstat (limited to 'app')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index b1db23acd..47f93e233 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, delayed = false) + def call(status, delayed: false, public_only: false) raise Mastodon::RaceConditionError if status.visibility.nil? deliver_to_self(status) if status.account.local? @@ -12,19 +12,23 @@ class FanOutOnWriteService < BaseService render_anonymous_payload(status) if status.direct_visibility? + return if public_only || status.curated deliver_to_mentioned_followers(status) deliver_to_direct_timelines(status) deliver_to_own_conversation(status) elsif status.limited_visibility? + return if public_only || status.curated deliver_to_mentioned_followers(status) elsif status.local_visibility? - deliver_to_followers(status) + deliver_to_followers(status) unless public_only || status.curated return if status.reblog? && !Setting.show_reblogs_in_public_timelines - deliver_to_lists(status) + deliver_to_lists(status) unless public_only || status.curated deliver_to_local(status) unless filtered?(status) else - deliver_to_followers(status) - deliver_to_lists(status) + unless public_only || status.curated + deliver_to_followers(status) + deliver_to_lists(status) + end return if status.reblog? && !Setting.show_reblogs_in_public_timelines return if filtered?(status) || (status.reblog? && filtered?(status.reblog)) |