Add `pleroma.in_reply_to_account_acct` to MastoAPI status entity
authorrinpatch <rinpatch@sdf.org>
Mon, 22 Apr 2019 08:53:37 +0000 (11:53 +0300)
committerrinpatch <rinpatch@sdf.org>
Mon, 22 Apr 2019 08:54:27 +0000 (11:54 +0300)
docs/api/differences_in_mastoapi_responses.md
lib/pleroma/web/mastodon_api/views/status_view.ex
test/web/mastodon_api/status_view_test.exs

index 63644fc56a4a013d2b426ee2a5c1e3a5af9d8110..3bb1bd41f7cb46d071c1e891ef97453f47b7453a 100644 (file)
@@ -20,6 +20,7 @@ Has these additional fields under the `pleroma` object:
 
 - `local`: true if the post was made on the local instance.
 - `conversation_id`: the ID of the conversation the status is associated with (if any)
+- `in_reply_to_account_acct`: the `acct` property of User entity for replied user (if any)
 - `content`: a map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`
 - `spoiler_text`: a map consisting of alternate representations of the `spoiler_text` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`
 
index 17c33080bb55fed51f309201d454e20b78a5bc70..decacb0f5542262fdee0bda29ae016ec181824e3 100644 (file)
@@ -238,6 +238,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       pleroma: %{
         local: activity.local,
         conversation_id: get_context_id(activity),
+        in_reply_to_account_acct: reply_to_user && reply_to_user.nickname,
         content: %{"text/plain" => content_plaintext},
         spoiler_text: %{"text/plain" => summary_plaintext}
       }
index fde931b4315ff498d1ba45db90d73322619f8c92..f74726212fa7eb8dafbe03a842b300b50d2d7c90 100644 (file)
@@ -128,6 +128,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
       pleroma: %{
         local: true,
         conversation_id: convo_id,
+        in_reply_to_account_acct: nil,
         content: %{"text/plain" => HtmlSanitizeEx.strip_tags(note.data["object"]["content"])},
         spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(note.data["object"]["summary"])}
       }