projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reroute /api/pleroma to /api/v1/pleroma
[akkoma]
/
lib
/
pleroma
/
user
/
search.ex
diff --git
a/lib/pleroma/user/search.ex
b/lib/pleroma/user/search.ex
index 03f2c552f2f29b82cf20909d2d830ea284f1dc85..a4f6abca24b358a0764977de3152f5a40a2868a4 100644
(file)
--- a/
lib/pleroma/user/search.ex
+++ b/
lib/pleroma/user/search.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.Search do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.User.Search do
@@
-54,8
+54,9
@@
defmodule Pleroma.User.Search do
defp maybe_add_uri_match(list, query) do
with {:ok, query} <- UriType.cast(query),
defp maybe_add_uri_match(list, query) do
with {:ok, query} <- UriType.cast(query),
- %User{} = user <- Pleroma.Repo.get_by(User, uri: query) do
- [user.id | list]
+ q = from(u in User, where: u.uri == ^query, select: u.id),
+ users = Pleroma.Repo.all(q) do
+ users ++ list
else
_ -> list
end
else
_ -> list
end
@@
-84,7
+85,6
@@
defmodule Pleroma.User.Search do
|> base_query(following)
|> filter_blocked_user(for_user)
|> filter_invisible_users()
|> base_query(following)
|> filter_blocked_user(for_user)
|> filter_invisible_users()
- |> filter_discoverable_users()
|> filter_internal_users()
|> filter_blocked_domains(for_user)
|> fts_search(query_string)
|> filter_internal_users()
|> filter_blocked_domains(for_user)
|> fts_search(query_string)
@@
-162,10
+162,6
@@
defmodule Pleroma.User.Search do
from(q in query, where: q.invisible == false)
end
from(q in query, where: q.invisible == false)
end
- defp filter_discoverable_users(query) do
- from(q in query, where: q.discoverable == true)
- end
-
defp filter_internal_users(query) do
from(q in query, where: q.actor_type != "Application")
end
defp filter_internal_users(query) do
from(q in query, where: q.actor_type != "Application")
end