From: Haelwenn (lanodan) Monnier Date: Mon, 21 Jan 2019 05:29:05 +0000 (+0100) Subject: Activity: all_by_object_ap_id/1 → get_all_by_object_ap_id/1 X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b82c6dc53685ebd26c276eccc5ed915ddf81afa6;p=akkoma Activity: all_by_object_ap_id/1 → get_all_by_object_ap_id/1 --- diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index 353f9f6cd..e3edec475 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -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 diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index d2e457a68..cfbe6c857 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -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) diff --git a/test/activity_test.exs b/test/activity_test.exs index 36c718869..8f3f613ec 100644 --- a/test/activity_test.exs +++ b/test/activity_test.exs @@ -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 diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index eafb96f3a..6538fb7af 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -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)