diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 48703e657..09a2ca404 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -93,7 +93,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} favourited: !!favorited, muted: false, sensitive: sensitive, - spoiler_text: "", + spoiler_text: object["summary"] || "", visibility: "public", media_attachments: attachments, mentions: mentions, diff --git a/test/support/factory.ex b/test/support/factory.ex index 33bacd40c..dabb95141 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -26,6 +26,7 @@ def note_factory do "likes" => [], "like_count" => 0, "context" => "2hu", + "summary" => "2hu", "tag" => ["2hu"], "emoji" => %{ "2hu" => "corndog.png" diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index 5aeee98c4..69d86ea82 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -32,7 +32,7 @@ test "a note activity" do favourited: false, muted: false, sensitive: false, - spoiler_text: "", + spoiler_text: note.data["object"]["summary"], visibility: "public", media_attachments: [], mentions: [],