projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable rendering of the client application data details
[akkoma]
/
lib
/
pleroma
/
user
/
query.ex
diff --git
a/lib/pleroma/user/query.ex
b/lib/pleroma/user/query.ex
index 2933e7fb4e9381a9f11ce95b3861dff2ce68f357..fa46545dad167478f6705394e00145adeaf35fb8 100644
(file)
--- a/
lib/pleroma/user/query.ex
+++ b/
lib/pleroma/user/query.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.User.Query do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.User.Query do
@@
-43,7
+43,7
@@
defmodule Pleroma.User.Query do
active: boolean(),
deactivated: boolean(),
need_approval: boolean(),
active: boolean(),
deactivated: boolean(),
need_approval: boolean(),
-
need_
confirmed: boolean(),
+
un
confirmed: boolean(),
is_admin: boolean(),
is_moderator: boolean(),
super_users: boolean(),
is_admin: boolean(),
is_moderator: boolean(),
super_users: boolean(),
@@
-56,7
+56,8
@@
defmodule Pleroma.User.Query do
ap_id: [String.t()],
order_by: term(),
select: term(),
ap_id: [String.t()],
order_by: term(),
select: term(),
- limit: pos_integer()
+ limit: pos_integer(),
+ actor_types: [String.t()]
}
| map()
}
| map()
@@
-115,6
+116,10
@@
defmodule Pleroma.User.Query do
where(query, [u], u.is_admin == ^bool)
end
where(query, [u], u.is_admin == ^bool)
end
+ defp compose_query({:actor_types, actor_types}, query) when is_list(actor_types) do
+ where(query, [u], u.actor_type in ^actor_types)
+ end
+
defp compose_query({:is_moderator, bool}, query) do
where(query, [u], u.is_moderator == ^bool)
end
defp compose_query({:is_moderator, bool}, query) do
where(query, [u], u.is_moderator == ^bool)
end
@@
-132,8
+137,9
@@
defmodule Pleroma.User.Query do
defp compose_query({:external, _}, query), do: location_query(query, false)
defp compose_query({:active, _}, query) do
defp compose_query({:external, _}, query), do: location_query(query, false)
defp compose_query({:active, _}, query) do
- User.restrict_deactivated(query)
- |> where([u], u.approval_pending == false)
+ where(query, [u], u.is_active == true)
+ |> where([u], u.is_approved == true)
+ |> where([u], u.is_confirmed == true)
end
defp compose_query({:legacy_active, _}, query) do
end
defp compose_query({:legacy_active, _}, query) do
@@
-142,23
+148,23
@@
defmodule Pleroma.User.Query do
end
defp compose_query({:deactivated, false}, query) do
end
defp compose_query({:deactivated, false}, query) do
-
User.restrict_deactivated(query
)
+
where(query, [u], u.is_active == true
)
end
defp compose_query({:deactivated, true}, query) do
end
defp compose_query({:deactivated, true}, query) do
- where(query, [u], u.
deactivated == ^tru
e)
+ where(query, [u], u.
is_active == fals
e)
end
defp compose_query({:confirmation_pending, bool}, query) do
end
defp compose_query({:confirmation_pending, bool}, query) do
- where(query, [u], u.
confirmation_pending =
= ^bool)
+ where(query, [u], u.
is_confirmed !
= ^bool)
end
defp compose_query({:need_approval, _}, query) do
end
defp compose_query({:need_approval, _}, query) do
- where(query, [u], u.
approval_pending
)
+ where(query, [u], u.
is_approved == false
)
end
end
- defp compose_query({:
need_
confirmed, _}, query) do
- where(query, [u], u.
confirmation_pending
)
+ defp compose_query({:
un
confirmed, _}, query) do
+ where(query, [u], u.
is_confirmed == false
)
end
defp compose_query({:followers, %User{id: id}}, query) do
end
defp compose_query({:followers, %User{id: id}}, query) do