From: Haelwenn (lanodan) Monnier Date: Wed, 2 Sep 2020 18:11:24 +0000 (+0200) Subject: search: Apply following filter only when user is usable X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=16c451f8f15b1b2907fb6fc40925b47821650f31;p=akkoma search: Apply following filter only when user is usable --- diff --git a/lib/pleroma/user/search.ex b/lib/pleroma/user/search.ex index adbef7fb8..7babd47ea 100644 --- a/lib/pleroma/user/search.ex +++ b/lib/pleroma/user/search.ex @@ -115,8 +115,8 @@ defmodule Pleroma.User.Search do ) end - defp base_query(_user, false), do: User - defp base_query(user, true), do: User.get_friends_query(user) + defp base_query(%User{} = user, true), do: User.get_friends_query(user) + defp base_query(_user, _following), do: User defp filter_invisible_users(query) do from(q in query, where: q.invisible == false)