[#1892] Excluded bot actors (applications, services) from search results.
This commit is contained in:
parent
b9e6ad571a
commit
3d2989278c
2 changed files with 13 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ defmodule Pleroma.User.Search do
|
|||
|> base_query(following)
|
||||
|> filter_blocked_user(for_user)
|
||||
|> filter_invisible_users()
|
||||
|> filter_bots()
|
||||
|> filter_blocked_domains(for_user)
|
||||
|> fts_search(query_string)
|
||||
|> trigram_rank(query_string)
|
||||
|
|
@ -109,6 +110,10 @@ defmodule Pleroma.User.Search do
|
|||
from(q in query, where: q.invisible == false)
|
||||
end
|
||||
|
||||
defp filter_bots(query) do
|
||||
from(q in query, where: q.actor_type not in ["Application", "Service"])
|
||||
end
|
||||
|
||||
defp filter_blocked_user(query, %User{} = blocker) do
|
||||
query
|
||||
|> join(:left, [u], b in Pleroma.UserRelationship,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue