MastoAPI: Include CW.
authorRoger Braun <roger@rogerbraun.net>
Tue, 31 Oct 2017 16:49:47 +0000 (17:49 +0100)
committerRoger Braun <roger@rogerbraun.net>
Tue, 31 Oct 2017 16:49:47 +0000 (17:49 +0100)
lib/pleroma/web/mastodon_api/views/status_view.ex
test/support/factory.ex
test/web/mastodon_api/status_view_test.exs

index 48703e657a0b36a81ac50553fa7544f9a64320be..09a2ca404a39515e2276ad32024551362838c02e 100644 (file)
@@ -93,7 +93,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       favourited: !!favorited,
       muted: false,
       sensitive: sensitive,
-      spoiler_text: "",
+      spoiler_text: object["summary"] || "",
       visibility: "public",
       media_attachments: attachments,
       mentions: mentions,
index 33bacd40cdab61c9c63c70c7ad99cc1f9415913d..dabb951415ff1bc882ad3c350c16f707e370ad29 100644 (file)
@@ -26,6 +26,7 @@ defmodule Pleroma.Factory do
       "likes" => [],
       "like_count" => 0,
       "context" => "2hu",
+      "summary" => "2hu",
       "tag" => ["2hu"],
       "emoji" => %{
         "2hu" => "corndog.png"
index 5aeee98c49937ff7a18fc8fca46a59f6e43818e1..69d86ea8235155d54ab5887378e025bde30b9cf7 100644 (file)
@@ -32,7 +32,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
       favourited: false,
       muted: false,
       sensitive: false,
-      spoiler_text: "",
+      spoiler_text: note.data["object"]["summary"],
       visibility: "public",
       media_attachments: [],
       mentions: [],