Activity: get_create_activity_by_object_ap_id/1 → get_create_by_object_ap_id/1
This commit is contained in:
parent
2fdbd4d137
commit
98c8184c1f
18 changed files with 52 additions and 53 deletions
|
|
@ -216,7 +216,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
|
||||
{:ok, user} = User.block(user, %{ap_id: activity_three.data["actor"]})
|
||||
{:ok, _announce, %{data: %{"id" => id}}} = CommonAPI.repeat(activity_three.id, booster)
|
||||
%Activity{} = boost_activity = Activity.get_create_activity_by_object_ap_id(id)
|
||||
%Activity{} = boost_activity = Activity.get_create_by_object_ap_id(id)
|
||||
activity_three = Repo.get(Activity, activity_three.id)
|
||||
|
||||
activities = ActivityPub.fetch_activities([], %{"blocking_user" => user})
|
||||
|
|
@ -445,7 +445,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
{:ok, object} =
|
||||
ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367")
|
||||
|
||||
assert activity = Activity.get_create_activity_by_object_ap_id(object.data["id"])
|
||||
assert activity = Activity.get_create_by_object_ap_id(object.data["id"])
|
||||
assert activity.data["id"]
|
||||
|
||||
{:ok, object_again} =
|
||||
|
|
@ -459,7 +459,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
|
||||
test "it works with objects only available via Ostatus" do
|
||||
{:ok, object} = ActivityPub.fetch_object_from_id("https://shitposter.club/notice/2827873")
|
||||
assert activity = Activity.get_create_activity_by_object_ap_id(object.data["id"])
|
||||
assert activity = Activity.get_create_by_object_ap_id(object.data["id"])
|
||||
assert activity.data["id"]
|
||||
|
||||
{:ok, object_again} =
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
{:ok, returned_activity} = Transmogrifier.handle_incoming(data)
|
||||
|
||||
assert activity =
|
||||
Activity.get_create_activity_by_object_ap_id(
|
||||
Activity.get_create_by_object_ap_id(
|
||||
"tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment"
|
||||
)
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
assert data["object"] ==
|
||||
"http://mastodon.example.org/users/admin/statuses/99541947525187367"
|
||||
|
||||
assert Activity.get_create_activity_by_object_ap_id(data["object"])
|
||||
assert Activity.get_create_by_object_ap_id(data["object"])
|
||||
end
|
||||
|
||||
test "it works for incoming announces with an existing activity" do
|
||||
|
|
@ -285,7 +285,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
|
||||
assert data["object"] == activity.data["object"]["id"]
|
||||
|
||||
assert Activity.get_create_activity_by_object_ap_id(data["object"]).id == activity.id
|
||||
assert Activity.get_create_by_object_ap_id(data["object"]).id == activity.id
|
||||
end
|
||||
|
||||
test "it does not clobber the addressing on announce activities" do
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
"https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
|
||||
)
|
||||
|
||||
%Activity{} = activity = Activity.get_create_activity_by_object_ap_id(object.data["id"])
|
||||
%Activity{} = activity = Activity.get_create_by_object_ap_id(object.data["id"])
|
||||
|
||||
represented = StatusView.render("status.json", %{for: user, activity: activity})
|
||||
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
|||
assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"]
|
||||
|
||||
# Also fetches the feed.
|
||||
# assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
|
||||
# assert Activity.get_create_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
|
|||
"https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
|
||||
)
|
||||
|
||||
%Activity{} = activity = Activity.get_create_activity_by_object_ap_id(object.data["id"])
|
||||
%Activity{} = activity = Activity.get_create_by_object_ap_id(object.data["id"])
|
||||
|
||||
result = ActivityView.render("activity.json", activity: activity)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue