From cb1b52d980e23c7d4f06dda5891bd2cbbdafeb95 Mon Sep 17 00:00:00 2001 From: Yonle Date: Fri, 15 Dec 2023 07:13:31 +0700 Subject: [PATCH 1/2] ap userview: add outbox field. Signed-off-by: Yonle --- changelog.d/add-outbox.fix | 1 + lib/pleroma/web/activity_pub/views/user_view.ex | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/add-outbox.fix diff --git a/changelog.d/add-outbox.fix b/changelog.d/add-outbox.fix new file mode 100644 index 000000000..f3de5338d --- /dev/null +++ b/changelog.d/add-outbox.fix @@ -0,0 +1 @@ +ap userview: add outbox field. diff --git a/lib/pleroma/web/activity_pub/views/user_view.ex b/lib/pleroma/web/activity_pub/views/user_view.ex index f69fca075..24ee683ae 100644 --- a/lib/pleroma/web/activity_pub/views/user_view.ex +++ b/lib/pleroma/web/activity_pub/views/user_view.ex @@ -46,6 +46,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do "following" => "#{user.ap_id}/following", "followers" => "#{user.ap_id}/followers", "inbox" => "#{user.ap_id}/inbox", + "outbox" => "#{user.ap_id}/outbox", "name" => "Pleroma", "summary" => "An internal service actor for this Pleroma instance. No user-serviceable parts inside.", From 766011544a0142299598b341e8495e37be7db9da Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Fri, 15 Dec 2023 10:01:31 +0400 Subject: [PATCH 2/2] UserViewTest: Add basice service actor test. --- test/pleroma/web/activity_pub/views/user_view_test.exs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/pleroma/web/activity_pub/views/user_view_test.exs b/test/pleroma/web/activity_pub/views/user_view_test.exs index 5f03c019e..f9068db07 100644 --- a/test/pleroma/web/activity_pub/views/user_view_test.exs +++ b/test/pleroma/web/activity_pub/views/user_view_test.exs @@ -76,6 +76,15 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do assert %{"invisible" => true} = UserView.render("service.json", %{user: user}) end + test "service has a few essential fields" do + user = insert(:user) + result = UserView.render("service.json", %{user: user}) + assert result["id"] + assert result["type"] == "Application" + assert result["inbox"] + assert result["outbox"] + end + test "renders AKAs" do akas = ["https://i.tusooa.xyz/users/test-pleroma"] user = insert(:user, also_known_as: akas)