about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-06 11:51:54 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:21 -0500
commit7580036307581a96790816683734433738ddd2b4 (patch)
tree59647e9e0d3f65900932dcdcf5062d53481b5de0 /app/services
parentb507a598c50676ac4b1ba0bbe483819ec33c5a6e (diff)
curated world: also consider public favs
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fan_out_on_write_service.rb5
-rw-r--r--app/services/favourite_service.rb3
2 files changed, 5 insertions, 3 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 2065acde3..a81482dd6 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)
+  def call(status, allow_nonlocal = false, deliver_to_local = true)
     raise Mastodon::RaceConditionError if status.visibility.nil?
 
     deliver_to_self(status) if status.account.local?
@@ -27,8 +27,7 @@ class FanOutOnWriteService < BaseService
     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 status.network? || status.relayed?
-    deliver_to_local = true
+    return unless allow_nonlocal || status.network? || status.relayed?
 
     if status.reblog? then
       status = Status.find(status.reblog_of_id)
diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb
index b565bcc32..fd7ade02b 100644
--- a/app/services/favourite_service.rb
+++ b/app/services/favourite_service.rb
@@ -16,6 +16,9 @@ class FavouriteService < BaseService
 
     favourite = Favourite.create!(account: account, status: status)
 
+    # stream it to the world timeline if public
+    FanOutOnWriteService.new.call(status, true, false) if status.public_visibility?
+
     create_notification(favourite)
     bump_potential_friendship(account, status)