ActivityPub: Fetch missing activities on reply.

This commit is contained in:
lain 2018-02-21 15:22:24 +01:00
commit 810cf8618f
4 changed files with 41 additions and 5 deletions

View file

@ -268,7 +268,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
describe "fetching an object" do
test "it fetches an object" do
{:ok, object} = ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367")
assert Activity.get_create_activity_by_object_ap_id(object.data["id"])
assert activity = Activity.get_create_activity_by_object_ap_id(object.data["id"])
assert activity.data["id"]
{:ok, object_again} = ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367")
assert [attachment] = object.data["attachment"]
@ -276,6 +278,16 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
assert object == object_again
end
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.data["id"]
{:ok, object_again} = ActivityPub.fetch_object_from_id("https://shitposter.club/notice/2827873")
assert object == object_again
end
end
describe "following / unfollowing" do