From 43d0b7bf7ae0e44366a56a6e0b9172b0caedd14a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 20 Sep 2018 16:10:46 +0200 Subject: [PATCH] [Pleroma.Web.MastodonAPI.StatusView] add replies_count --- lib/pleroma/web/mastodon_api/views/status_view.ex | 2 ++ test/web/mastodon_api/status_view_test.exs | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 284df837a..ffc105196 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -63,6 +63,7 @@ def render( content: reblogged[:content], created_at: created_at, reblogs_count: 0, + replies_count: 0, favourites_count: 0, reblogged: false, favourited: false, @@ -132,6 +133,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} content: render_content(object), created_at: created_at, reblogs_count: announcement_count, + replies_count: 0, favourites_count: like_count, reblogged: !!repeated, favourited: !!favorited, diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index b3b6c5851..b9c019206 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -28,6 +28,7 @@ test "a note activity" do content: HtmlSanitizeEx.basic_html(note.data["object"]["content"]), created_at: created_at, reblogs_count: 0, + replies_count: 0, favourites_count: 0, reblogged: false, favourited: false,