diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-14 20:55:45 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-14 20:55:45 +0300 |
commit | 95529ab709b14acbf0b4ef2c17a76e0540e1e84e (patch) | |
tree | 0ec69c4651bdc8fd1ff8c6b9beb937f4062a0b6d /lib/pleroma/user.ex | |
parent | 33e508d7c6bae4f2b48568c50e1573fb4cbcffd3 (diff) | |
download | pleroma-95529ab709b14acbf0b4ef2c17a76e0540e1e84e.tar.gz |
[#2046] Defaulted pleroma/restrict_unauthenticated basing on instance privacy setting (i.e. restrict on private instances only by default).
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r-- | lib/pleroma/user.ex | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index d1436a688..ac065e9dc 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -311,10 +311,12 @@ defmodule Pleroma.User do def visible_for(_, _), do: :invisible - defp restrict_unauthenticated?(%User{local: local}) do - config_key = if local, do: :local, else: :remote + defp restrict_unauthenticated?(%User{local: true}) do + Config.restrict_unauthenticated_access?(:profiles, :local) + end - Config.get([:restrict_unauthenticated, :profiles, config_key], false) + defp restrict_unauthenticated?(%User{local: _}) do + Config.restrict_unauthenticated_access?(:profiles, :remote) end defp visible_account_status(user) do |