[TwitterAPI] add in_reply_to_screen_name to statuses

Closes: https://git.pleroma.social/pleroma/pleroma/issues/68
This commit is contained in:
Haelwenn (lanodan) Monnier 2018-06-17 13:32:31 +02:00
parent d93789dfde
commit fdfeff3013
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
2 changed files with 4 additions and 0 deletions

View File

@ -138,9 +138,12 @@ defmodule Pleroma.Web.CommonAPI.Utils do
} }
if inReplyTo do if inReplyTo do
reply_nickname = User.get_cached_by_ap_id(inReplyTo.data["object"]["actor"]).nickname || ""
object object
|> Map.put("inReplyTo", inReplyTo.data["object"]["id"]) |> Map.put("inReplyTo", inReplyTo.data["object"]["id"])
|> Map.put("inReplyToStatusId", inReplyTo.id) |> Map.put("inReplyToStatusId", inReplyTo.id)
|> Map.put("inReplyToScreenName", reply_nickname)
else else
object object
end end

View File

@ -180,6 +180,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"is_post_verb" => true, "is_post_verb" => true,
"created_at" => created_at, "created_at" => created_at,
"in_reply_to_status_id" => object["inReplyToStatusId"], "in_reply_to_status_id" => object["inReplyToStatusId"],
"in_reply_to_screen_name" => object["inReplyToScreenName"],
"statusnet_conversation_id" => conversation_id, "statusnet_conversation_id" => conversation_id,
"attachments" => (object["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts), "attachments" => (object["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts),
"attentions" => attentions, "attentions" => attentions,