diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-03-24 20:19:22 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:16:21 -0500 |
commit | ba51d3f135645e5f6d39f9fd0c03eaa03434bc5f (patch) | |
tree | 5b9105adbfb4a7e0adc140fccc85f1f8d260c5b5 /app/models/status.rb | |
parent | 3e8d7fd5f8264ed5e59cbed5d2fb5572590ab774 (diff) |
add option to show raw world timeline
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 37eae21aa..f8c11d109 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -351,25 +351,29 @@ class Status < ApplicationRecord end def as_public_timeline(account = nil, local_only = false) - # instead of our ftl being a noisy irrelevant firehose - # only show public stuff boosted by the community - query = Status.network - if local_only then - # we don't want to change the ltl - query = query - .with_public_visibility - .without_replies - .without_reblogs - else # but on the ftl - query = query.without_replies unless Setting.show_replies_in_public_timelines - # grab the stuff we boosted - subquery = 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 + if account.present? && account&.user&.setting_rawr_federated + 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 + query = Status.network + if local_only then + # we don't want to change the ltl + query = query + .with_public_visibility + .without_replies + .without_reblogs + else # but on the ftl + query = query.without_replies unless Setting.show_replies_in_public_timelines + # grab the stuff we boosted + subquery = 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 + end end apply_timeline_filters(query, account, local_only) |