Merge remote-tracking branch 'remotes/origin/develop' into 1560-non-federating-instan...
[akkoma] / lib / pleroma / user / query.ex
index 2eda454bc7d6acef7da967602c1572b2a8020471..884e33039d7453caae0166fef206df27798bc107 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # 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