Parcourir la source

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
tags/v0.9.9
eal il y a 6 ans
Parent
révision
a938d07df1
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. +2
    -2
      lib/pleroma/web/mastodon_api/views/status_view.ex
  2. +2
    -2
      test/web/mastodon_api/status_view_test.exs

+ 2
- 2
lib/pleroma/web/mastodon_api/views/status_view.ex Voir le fichier

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


+ 2
- 2
test/web/mastodon_api/status_view_test.exs Voir le fichier

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


Chargement…
Annuler
Enregistrer