aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-06-11 19:52:07 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-06-11 19:52:07 -0400
commit44613db853226015207977ee958ebbf4d26f7c00 (patch)
treec9b8f38154ec60093d331f99706cecdada6872fe /lib/pleroma/web
parent95b39223281a61f3ee7d52776df2713952de3be0 (diff)
downloadpleroma-44613db853226015207977ee958ebbf4d26f7c00.tar.gz
Show original status at the first of history
Diffstat (limited to 'lib/pleroma/web')
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 6ede89803..8439431eb 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -418,13 +418,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|> Enum.map(&Map.put(&1, "id", object.data["id"]))
|> Enum.map(&%Object{data: &1, id: object.id})
- history = [object | past_history]
-
- history_len = length(history)
-
history =
- Enum.zip(history_len..0, history)
- |> Enum.map(fn {chrono_order, object} ->
+ [object | past_history]
+ # Mastodon expects the original to be at the first
+ |> Enum.reverse()
+ |> Enum.with_index()
+ |> Enum.map(fn {object, chrono_order} ->
%{
# The history is prepended every time there is a new edit.
# In chrono_order, the oldest item is always at 0, and so on.