logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: a938d07df1679efd78e1b7c10e149270489761f7
parent: 00d7d109efd3315cff7e73dfb5b3064bf0dbe25c
Author: eal <eal@waifu.club>
Date:   Fri, 15 Jun 2018 20:43:30 +0000

Merge branch 'bugfix/mastofe_thread_render' into 'develop'

lib/pleroma/web/mastodon_api/views/status_view.ex: Fix status.json so it renders threads

See merge request pleroma/pleroma!223

Diffstat:

Mlib/pleroma/web/mastodon_api/views/status_view.ex4++--
Mtest/web/mastodon_api/status_view_test.exs4++--
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 @@ -125,8 +125,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do 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 @@ -64,11 +64,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest 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