simplification of formatting host method
[akkoma] / lib / pleroma / activity.ex
index 10b6d7ebd0e2ac16e6fd75c350385b864aaa0108..397eb6e3f614bafe8140152682b7f422797f94a2 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.Activity do
@@ -310,7 +310,7 @@ defmodule Pleroma.Activity do
 
   def restrict_deactivated_users(query) do
     deactivated_users =
-      from(u in User.Query.build(deactivated: true), select: u.ap_id)
+      from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)
       |> Repo.all()
 
     Activity.Queries.exclude_authors(query, deactivated_users)
@@ -330,23 +330,4 @@ defmodule Pleroma.Activity do
       _ -> nil
     end
   end
-
-  def replies(activity, opts \\ []) do
-    object = Object.normalize(activity)
-
-    query =
-      Activity
-      |> Queries.by_type("Create")
-      |> Queries.by_object_in_reply_to_id(object.data["id"], skip_preloading: true)
-      |> order_by([activity], asc: activity.id)
-
-    if opts[:self_only] do
-      where(query, [a], a.actor == ^activity.actor)
-    else
-      query
-    end
-  end
-
-  def self_replies(activity, opts \\ []),
-    do: replies(activity, Keyword.put(opts, :self_only, true))
 end