commit: 7622a83973d9b904c9536413e7c0d026dcc51393
parent 02acf7c0b3e6711262f9f57cfc0554ce8e4ed50d
Author: lain <lain@soykaf.club>
Date: Fri, 15 Dec 2023 06:22:55 +0000
Merge branch 'service-actor-outbox' into 'develop'
ap userview: add outbox field.
See merge request pleroma/pleroma!4002
Diffstat:
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/changelog.d/add-outbox.fix 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
@@ -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.",
diff --git 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)