X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser%2Fquery.ex;h=884e33039d7453caae0166fef206df27798bc107;hb=99a6c660a909d8c74289015b3f69357196256112;hp=2eda454bc7d6acef7da967602c1572b2a8020471;hpb=fcea6a9d2c7ae3223a6ec5038869a68ec618cb77;p=akkoma diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex index 2eda454bc..884e33039 100644 --- a/lib/pleroma/user/query.ex +++ b/lib/pleroma/user/query.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.Query do @@ -48,7 +48,7 @@ defmodule Pleroma.User.Query do followers: User.t(), friends: User.t(), recipients_from_activity: [String.t()], - nickname: [String.t()], + nickname: [String.t()] | String.t(), ap_id: [String.t()], order_by: term(), select: term(), @@ -175,6 +175,7 @@ defmodule Pleroma.User.Query do [u, following: f, relationships: r], u.ap_id in ^to or (f.follower_address in ^to and r.state == "accept") ) + |> distinct(true) end defp compose_query({:order_by, key}, query) do