2
0

Split timeline_preview setting into more granular settings (#36338)

This commit is contained in:
Claire
2025-10-06 10:34:05 +02:00
committed by GitHub
parent 62f91eddf4
commit 2d2c525097
88 changed files with 156 additions and 173 deletions

View File

@@ -2,6 +2,7 @@
class Api::V1::Timelines::PublicController < Api::V1::Timelines::BaseController
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
before_action :require_user!, if: :require_auth?
PERMITTED_PARAMS = %i(local remote limit only_media).freeze
@@ -13,6 +14,16 @@ class Api::V1::Timelines::PublicController < Api::V1::Timelines::BaseController
private
def require_auth?
if truthy_param?(:local)
Setting.local_live_feed_access != 'public'
elsif truthy_param?(:remote)
Setting.remote_live_feed_access != 'public'
else
Setting.local_live_feed_access != 'public' || Setting.remote_live_feed_access != 'public'
end
end
def load_statuses
preloaded_public_statuses_page
end