import Pleroma.Web.ControllerHelper,
only: [add_link_headers: 2, add_link_headers: 3]
+ alias Pleroma.Config
alias Pleroma.Pagination
alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
alias Pleroma.Plugs.OAuthScopesPlug
)
end
- defp restrict_unauthenticated?(local_only) do
- config_key =
- if local_only do
- :local
- else
- :federated
- end
+ defp restrict_unauthenticated?(true = _local_only) do
+ Config.restrict_unauthenticated_access?(:timelines, :local)
+ end
- Pleroma.Config.get([:restrict_unauthenticated, :timelines, config_key])
+ defp restrict_unauthenticated?(_) do
+ Config.restrict_unauthenticated_access?(:timelines, :federated)
end
# GET /api/v1/timelines/public