From 94db0b7cd604022c65b9f70e5c5a939ac3ed4801 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 27 Jul 2021 08:28:52 -0500 Subject: [PATCH 1/3] Add activity+json to Phoenix :format_encoders Fixes ErrorView rendering --- config/config.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.exs b/config/config.exs index 66aee3264..abedd2fbe 100644 --- a/config/config.exs +++ b/config/config.exs @@ -452,7 +452,7 @@ config :pleroma, :chat, enabled: true -config :phoenix, :format_encoders, json: Jason +config :phoenix, :format_encoders, json: Jason, "activity+json": Jason config :phoenix, :json_library, Jason From 3d8ce61fe50747c0025082a0c8fddf0fa73bcf96 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 27 Jul 2021 08:30:38 -0500 Subject: [PATCH 2/3] CHANGELOG: fixed JSON error rendering --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 155248a81..0dc536c55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remote users can no longer reappear after being deleted. - Deactivated users may now be deleted. - Mix task `pleroma.database prune_objects` +- Fixed rendering of JSON errors on ActivityPub endpoints. - Linkify: Parsing crash with URLs ending in unbalanced closed paren, no path separator, and no query parameters ### Removed From 9cc8642b80a3eceac405751a9c6b0be8e55db56d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 27 Jul 2021 08:54:01 -0500 Subject: [PATCH 3/3] Visibility: check Tombstone objects in visible_for_user?/2 --- lib/pleroma/web/activity_pub/visibility.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/web/activity_pub/visibility.ex b/lib/pleroma/web/activity_pub/visibility.ex index 00234c0b0..6d8d7e442 100644 --- a/lib/pleroma/web/activity_pub/visibility.ex +++ b/lib/pleroma/web/activity_pub/visibility.ex @@ -57,6 +57,7 @@ def is_list?(%{data: %{"listMessage" => _}}), do: true def is_list?(_), do: false @spec visible_for_user?(Object.t() | Activity.t() | nil, User.t() | nil) :: boolean() + def visible_for_user?(%Object{data: %{"type" => "Tombstone"}}, _), do: false def visible_for_user?(%Activity{actor: ap_id}, %User{ap_id: ap_id}), do: true def visible_for_user?(%Object{data: %{"actor" => ap_id}}, %User{ap_id: ap_id}), do: true def visible_for_user?(nil, _), do: false