about summary refs log tree commit diff
path: root/app/models
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/models
parentb507a598c50676ac4b1ba0bbe483819ec33c5a6e (diff)
curated world: also consider public favs
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index dcf53a5ea..1dfe8715b 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -356,7 +356,7 @@ class Status < ApplicationRecord
         query = timeline_scope(local_only).without_replies
       else
         # instead of our ftl being a noisy irrelevant firehose
-        # only show public stuff boosted by the community
+        # only show public stuff boosted/faved by the community
         query = Status.network
         if local_only then
           # we don't want to change the ltl
@@ -366,14 +366,21 @@ class Status < ApplicationRecord
             .without_reblogs
         else # but on the ftl
           query = query.without_replies unless Setting.show_replies_in_public_timelines
+          # grab the stuff we faved
+          fav_query = Favourite.select('status_id')
+            .where(account_id: Account.local)
+            .reorder(:status_id)
+            .distinct
           # grab the stuff we boosted
-          subquery = query.reblogs.select(:reblog_of_id)
+          boost_query = query.reblogs.select(:reblog_of_id)
             .reorder(nil)
             .distinct
           # map those ids to actual statuses
           # THIS QUERY IS EXPENSIVE AS FUCK!!!!!!!
           # but it does the job
-          query = Status.where(id: subquery).with_public_visibility
+          query = Status.where(id: boost_query)
+            .or(where(id: fav_query))
+            .with_public_visibility
         end
       end