mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-17 23:38:19 +00:00
print <link rel="next"> element in atom.feed
This commit is contained in:
parent
7124f12a94
commit
a61f21ff4f
|
@ -10,6 +10,8 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do
|
|||
|
||||
h = fn(str) -> [to_charlist(str)] end
|
||||
|
||||
last_activity = List.last(activities)
|
||||
|
||||
entries = activities
|
||||
|> Enum.map(fn(activity) ->
|
||||
{:entry, ActivityRepresenter.to_simple_form(activity, user)}
|
||||
|
@ -32,7 +34,15 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do
|
|||
{:link, [rel: 'salmon', href: h.(OStatus.salmon_path(user))], []},
|
||||
{:link, [rel: 'self', href: h.(OStatus.feed_path(user)), type: 'application/atom+xml'], []},
|
||||
{:author, UserRepresenter.to_simple_form(user)},
|
||||
] ++ entries
|
||||
] ++
|
||||
if last_activity do
|
||||
[{:link, [rel: 'next',
|
||||
href: to_charlist(OStatus.feed_path(user)) ++ '?max_id=' ++ to_charlist(last_activity.id),
|
||||
type: 'application/atom+xml'], []}]
|
||||
else
|
||||
[]
|
||||
end
|
||||
++ entries
|
||||
}]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue