diff options
author | lain <lain@soykaf.club> | 2020-07-03 14:38:22 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-03 14:38:22 +0000 |
commit | 19fbfbb767169b58a8f6558d0ad1a9be6425b59d (patch) | |
tree | 41f518090405408c5db8c352648fe3d91ab09578 /lib | |
parent | 86151b23a6c3e51ae4eb7c5ed77a8f090e7fa139 (diff) | |
parent | 90764670dc83c39c28cd7851f08f77f1e8bcf25a (diff) | |
download | pleroma-19fbfbb767169b58a8f6558d0ad1a9be6425b59d.tar.gz |
Merge branch '1892-exclude-bots-from-search-results' into 'develop'
[#1892] Exclusion of service actors from user search results
Closes #1892
See merge request pleroma/pleroma!2708
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user/search.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/user/search.ex b/lib/pleroma/user/search.ex index cec59c372..42ff1de78 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_internal_users() |> 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_internal_users(query) do + from(q in query, where: q.actor_type != "Application") + end + defp filter_blocked_user(query, %User{} = blocker) do query |> join(:left, [u], b in Pleroma.UserRelationship, |