Activity: create_activity_by_object_id_query/1 → create_by_object_ap_id/1 when is_list
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 21 Jan 2019 06:07:54 +0000 (07:07 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 21 Jan 2019 07:00:40 +0000 (08:00 +0100)
lib/pleroma/activity.ex
lib/pleroma/web/mastodon_api/views/status_view.ex

index 8c73d1fa00efb5d249fabe4a84b0cec703fb5d94..5c3b8fcc58f4085e3ee4b083edd5a37f412174da 100644 (file)
@@ -63,7 +63,7 @@ defmodule Pleroma.Activity do
     )
   end
 
-  def create_activity_by_object_id_query(ap_ids) do
+  def create_by_object_ap_id(ap_ids) when is_list(ap_ids) do
     from(
       activity in Activity,
       where:
@@ -82,7 +82,7 @@ defmodule Pleroma.Activity do
   end
 
   def get_create_activity_by_object_ap_id(ap_id) when is_binary(ap_id) do
-    create_activity_by_object_id_query([ap_id])
+    create_by_object_ap_id(ap_id)
     |> Repo.one()
   end
 
index 7f5a52ea3e094339a1a32919b0ee96cef7e531fc..5e9c5c53302f9d98ae1655131f5b5af02fd2476a 100644 (file)
@@ -25,7 +25,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
         nil
     end)
     |> Enum.filter(& &1)
-    |> Activity.create_activity_by_object_id_query()
+    |> Activity.create_by_object_ap_id()
     |> Repo.all()
     |> Enum.reduce(%{}, fn activity, acc ->
       Map.put(acc, activity.data["object"]["id"], activity)