Show edited_at in MastodonAPI/show
This commit is contained in:
parent
fdaa864083
commit
3249ac1f12
3 changed files with 33 additions and 0 deletions
|
|
@ -73,6 +73,12 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
|
|||
format: "date-time",
|
||||
description: "The date when this status was created"
|
||||
},
|
||||
edited_at: %Schema{
|
||||
type: :string,
|
||||
format: "date-time",
|
||||
nullable: true,
|
||||
description: "The date when this status was last edited"
|
||||
},
|
||||
emojis: %Schema{
|
||||
type: :array,
|
||||
items: Emoji,
|
||||
|
|
|
|||
|
|
@ -258,6 +258,16 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
|
||||
created_at = Utils.to_masto_date(object.data["published"])
|
||||
|
||||
edited_at =
|
||||
with %{"updated" => updated} <- object.data,
|
||||
date <- Utils.to_masto_date(updated),
|
||||
true <- date != "" do
|
||||
date
|
||||
else
|
||||
_ ->
|
||||
nil
|
||||
end
|
||||
|
||||
reply_to = get_reply_to(activity, opts)
|
||||
|
||||
reply_to_user = reply_to && CommonAPI.get_user(reply_to.data["actor"])
|
||||
|
|
@ -346,6 +356,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
content: content_html,
|
||||
text: opts[:with_source] && object.data["source"],
|
||||
created_at: created_at,
|
||||
edited_at: edited_at,
|
||||
reblogs_count: announcement_count,
|
||||
replies_count: object.data["repliesCount"] || 0,
|
||||
favourites_count: like_count,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue