Activity: all_by_object_ap_id/1 → get_all_by_object_ap_id/1
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 21 Jan 2019 05:29:05 +0000 (06:29 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 21 Jan 2019 06:49:59 +0000 (07:49 +0100)
lib/pleroma/activity.ex
lib/pleroma/web/activity_pub/utils.ex
test/activity_test.exs
test/web/activity_pub/activity_pub_test.exs

index 353f9f6cd7722d915369218576540e77c2efc89e..e3edec4750eeeb60bfce8782ea7df36c191587b5 100644 (file)
@@ -67,8 +67,7 @@ defmodule Pleroma.Activity do
     )
   end
 
-  # Wrong name plz fix thx
-  def all_by_object_ap_id(ap_id) do
+  def get_all_by_object_ap_id(ap_id) do
     Repo.all(all_by_object_ap_id_q(ap_id))
   end
 
index d2e457a680e289278fd90d9b4e5c485b744c2807..cfbe6c85735f4f4d7ec1a599c456f49a8a0d21a3 100644 (file)
@@ -198,7 +198,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do
     # Update activities that already had this. Could be done in a seperate process.
     # Alternatively, just don't do this and fetch the current object each time. Most
     # could probably be taken from cache.
-    relevant_activities = Activity.all_by_object_ap_id(id)
+    relevant_activities = Activity.get_all_by_object_ap_id(id)
 
     Enum.map(relevant_activities, fn activity ->
       new_activity_data = activity.data |> Map.put("object", object.data)
index 36c718869cc5acde56ac301ec69066faba1e2bff..8f3f613ece48e9758f2e4fb254200585f7743e56 100644 (file)
@@ -16,7 +16,7 @@ defmodule Pleroma.ActivityTest do
 
   test "returns activities by it's objects AP ids" do
     activity = insert(:note_activity)
-    [found_activity] = Activity.all_by_object_ap_id(activity.data["object"]["id"])
+    [found_activity] = Activity.get_all_by_object_ap_id(activity.data["object"]["id"])
 
     assert activity == found_activity
   end
index eafb96f3a303cfd798577e251c3e4754e3d9c878..6538fb7afe638e260cf08277b6186c23d9925354 100644 (file)
@@ -330,7 +330,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
       assert like_activity == same_like_activity
       assert object.data["likes"] == [user.ap_id]
 
-      [note_activity] = Activity.all_by_object_ap_id(object.data["id"])
+      [note_activity] = Activity.get_all_by_object_ap_id(object.data["id"])
       assert note_activity.data["object"]["like_count"] == 1
 
       {:ok, _like_activity, object} = ActivityPub.like(user_two, object)