aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-06-30 21:26:39 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-06-30 21:26:39 +0300
commit3d2989278c2f97fb5247d0b58b99b77f400f3185 (patch)
tree2b7ab5cf36bfdc77082d0709ac866065ff91ac59 /lib
parentb9e6ad571ac5925431466d6e6b27c0b372bb7727 (diff)
downloadpleroma-3d2989278c2f97fb5247d0b58b99b77f400f3185.tar.gz
[#1892] Excluded bot actors (applications, services) from search results.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user/search.ex5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/user/search.ex b/lib/pleroma/user/search.ex
index cec59c372..0293c6ae7 100644
--- a/lib/pleroma/user/search.ex
+++ b/lib/pleroma/user/search.ex
@@ -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,