Commit 595a9704 authored by kaniini's avatar kaniini
Browse files

user: use pattern matching to determine if user is local or remote instead of...

user: use pattern matching to determine if user is local or remote instead of the previous hairy logic
parent 4e5b1560
......@@ -49,7 +49,8 @@ def auth_active?(%User{} = user) do
!Pleroma.Config.get([:instance, :account_activation_required])
end
def remote_or_auth_active?(%User{} = user), do: !user.local || auth_active?(user)
def remote_or_auth_active?(%User{local: false}), do: true
def remote_or_auth_active?(%User{local: true} = user), do: auth_active?(user)
def visible_for?(%User{} = user, for_user \\ nil) do
User.remote_or_auth_active?(user) || (for_user && for_user.id == user.id) ||
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment