Commit a61f21ff authored by hakabahitoyo's avatar hakabahitoyo Committed by Hakaba Hitoyo

print <link rel="next"> element in atom.feed

parent 7124f12a
...@@ -10,6 +10,8 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do ...@@ -10,6 +10,8 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do
h = fn(str) -> [to_charlist(str)] end h = fn(str) -> [to_charlist(str)] end
last_activity = List.last(activities)
entries = activities entries = activities
|> Enum.map(fn(activity) -> |> Enum.map(fn(activity) ->
{:entry, ActivityRepresenter.to_simple_form(activity, user)} {:entry, ActivityRepresenter.to_simple_form(activity, user)}
...@@ -32,7 +34,15 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do ...@@ -32,7 +34,15 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do
{:link, [rel: 'salmon', href: h.(OStatus.salmon_path(user))], []}, {:link, [rel: 'salmon', href: h.(OStatus.salmon_path(user))], []},
{:link, [rel: 'self', href: h.(OStatus.feed_path(user)), type: 'application/atom+xml'], []}, {:link, [rel: 'self', href: h.(OStatus.feed_path(user)), type: 'application/atom+xml'], []},
{:author, UserRepresenter.to_simple_form(user)}, {: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
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment