1
0
Fork 0
forked from mirrors/akkoma

Pleroma.Web.MastodonAPI.StatusView: Fix status.json so it renders threads

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-06-15 21:37:29 +02:00
parent de20c8d620
commit 72c2915ecd
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
2 changed files with 4 additions and 4 deletions

View file

@ -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,

View file

@ -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