forked from YokaiRick/akkoma
Reverse mastodon timeline data.
This commit is contained in:
parent
e8975d06be
commit
96473dfac0
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,7 @@ def masto_instance(conn, _params) do
|
||||||
|
|
||||||
def home_timeline(%{assigns: %{user: user}} = conn, params) do
|
def home_timeline(%{assigns: %{user: user}} = conn, params) do
|
||||||
activities = ActivityPub.fetch_activities([user.ap_id | user.following], Map.put(params, "type", "Create"))
|
activities = ActivityPub.fetch_activities([user.ap_id | user.following], Map.put(params, "type", "Create"))
|
||||||
|
|> Enum.reverse
|
||||||
render conn, StatusView, "index.json", %{activities: activities, for: user, as: :activity}
|
render conn, StatusView, "index.json", %{activities: activities, for: user, as: :activity}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ def public_timeline(%{assigns: %{user: user}} = conn, params) do
|
||||||
|> Map.put("local_only", !!params["local"])
|
|> Map.put("local_only", !!params["local"])
|
||||||
|
|
||||||
activities = ActivityPub.fetch_public_activities(params)
|
activities = ActivityPub.fetch_public_activities(params)
|
||||||
|
|> Enum.reverse
|
||||||
|
|
||||||
render conn, StatusView, "index.json", %{activities: activities, for: user, as: :activity}
|
render conn, StatusView, "index.json", %{activities: activities, for: user, as: :activity}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue