1 defmodule Pleroma.Web.OStatus.FeedRepresenter do
2 alias Pleroma.Web.OStatus
3 alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter}
5 def to_simple_form(user, activities, users) do
6 most_recent_update = List.first(activities).updated_at
7 |> NaiveDateTime.to_iso8601
9 h = fn(str) -> [to_charlist(str)] end
11 entries = Enum.map(activities, fn(activity) ->
12 {:entry, ActivityRepresenter.to_simple_form(activity, user)}
17 xmlns: 'http://www.w3.org/2005/Atom',
18 "xmlns:activity": 'http://activitystrea.ms/spec/1.0/'
20 {:id, h.(OStatus.feed_path(user))},
21 {:title, ['#{user.nickname}\'s timeline']},
22 {:updated, h.(most_recent_update)},
23 {:link, [rel: 'hub', href: h.(OStatus.pubsub_path(user))], []},
24 {:author, UserRepresenter.to_simple_form(user)}