aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2019-01-09 06:36:50 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2019-01-09 06:36:50 +0000
commit74f48beec3bf78cd94cb6db5cbdb937505891eab (patch)
tree1a0ed2dadb80848015af1027a2bc43d4f748cf8d /lib
parent2af67353c5014edcc24bf2ec27b2bc871bd80eb7 (diff)
downloadpleroma-74f48beec3bf78cd94cb6db5cbdb937505891eab.tar.gz
user: remove entirely redundant remote_or_auth_active?/1.
auth_active?/1 can check remote users and return true directly.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user.ex7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 5491e8b9a..636c56312 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -44,6 +44,8 @@ defmodule Pleroma.User do
timestamps()
end
+ def auth_active?(%User{local: false}), do: false
+
def auth_active?(%User{info: %User.Info{confirmation_pending: false}}), do: true
def auth_active?(%User{info: %User.Info{confirmation_pending: true}}),
@@ -51,15 +53,12 @@ defmodule Pleroma.User do
def auth_active?(_), do: false
- 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, for_user \\ nil)
def visible_for?(%User{id: user_id}, %User{id: for_id}) when user_id == for_id, do: true
def visible_for?(%User{} = user, for_user) do
- remote_or_auth_active?(user) || superuser?(for_user)
+ auth_active?(user) || superuser?(for_user)
end
def visible_for?(_, _), do: false