MastoAPI AccountView: Change last_status_at to be a date
Changed in Mastodon 3.1.0 with: https://github.com/tootsuite/mastodon/pull/12966
This commit is contained in:
parent
bf2d6abaf2
commit
8ac7cc98c1
|
@ -0,0 +1 @@
|
|||
- Change AccountView `last_status_at` from a datetime to a date (as done in Mastodon 3.1.0)
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.MastodonAPI.AccountView do
|
||||
|
@ -249,6 +249,13 @@ defp do_render("show.json", %{user: user} = opts) do
|
|||
nil
|
||||
end
|
||||
|
||||
last_status_at =
|
||||
if not is_nil(user.last_status_at) do
|
||||
user.last_status_at |> NaiveDateTime.to_date() |> Date.to_iso8601()
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
||||
%{
|
||||
id: to_string(user.id),
|
||||
username: username_from_nickname(user.nickname),
|
||||
|
@ -277,7 +284,7 @@ defp do_render("show.json", %{user: user} = opts) do
|
|||
actor_type: user.actor_type
|
||||
}
|
||||
},
|
||||
last_status_at: user.last_status_at,
|
||||
last_status_at: last_status_at,
|
||||
|
||||
# Pleroma extensions
|
||||
# Note: it's insecure to output :email but fully-qualified nickname may serve as safe stub
|
||||
|
|
Loading…
Reference in New Issue