From 72c2915ecd0b6578d72b3c9796f4adc8cce83d86 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 15 Jun 2018 21:37:29 +0200 Subject: [PATCH] Pleroma.Web.MastodonAPI.StatusView: Fix status.json so it renders threads --- lib/pleroma/web/mastodon_api/views/status_view.ex | 4 ++-- test/web/mastodon_api/status_view_test.exs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index d1d48cd0a..59898457b 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -125,8 +125,8 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} uri: object["id"], url: object["external_url"] || object["id"], account: AccountView.render("account.json", %{user: user}), - in_reply_to_id: reply_to && reply_to.id, - in_reply_to_account_id: reply_to_user && reply_to_user.id, + in_reply_to_id: reply_to && to_string(reply_to.id), + in_reply_to_account_id: reply_to_user && to_string(reply_to_user.id), reblog: nil, content: HtmlSanitizeEx.basic_html(object["content"]), created_at: created_at, diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index d9a0a8a95..d28c3cbad 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -64,11 +64,11 @@ test "a reply" do status = StatusView.render("status.json", %{activity: activity}) - assert status.in_reply_to_id == note.id + assert status.in_reply_to_id == to_string(note.id) [status] = StatusView.render("index.json", %{activities: [activity], as: :activity}) - assert status.in_reply_to_id == note.id + assert status.in_reply_to_id == to_string(note.id) end test "contains mentions" do