aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-07-08 12:36:44 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-07-08 12:36:44 +0300
commit3f8370a285d1ee705e4899656b88c442c50cb99b (patch)
tree784e05dd1ddddb6ea50abf0fc16ca5ac818d117d /lib
parent20461137a37968ee4dc8e3a38f7d9c63714702d3 (diff)
downloadpleroma-3f8370a285d1ee705e4899656b88c442c50cb99b.tar.gz
[#1895] Applied code review suggestion.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
index 4bbb82c23..a23f47e54 100644
--- a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
@@ -88,15 +88,12 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do
)
end
- defp restrict_unauthenticated?(local_only) do
- config_key =
- if local_only do
- :local
- else
- :federated
- end
-
- Pleroma.Config.get([:restrict_unauthenticated, :timelines, config_key])
+ defp restrict_unauthenticated?(_local_only = true) do
+ Pleroma.Config.get([:restrict_unauthenticated, :timelines, :local])
+ end
+
+ defp restrict_unauthenticated?(_) do
+ Pleroma.Config.get([:restrict_unauthenticated, :timelines, :federated])
end
# GET /api/v1/timelines/public