<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xmlns:activity="http://activitystrea.ms/spec/1.0/"
  xmlns:poco="http://portablecontacts.net/spec/1.0"
  xmlns:ostatus="http://ostatus.org/schema/1.0"
  xmlns:source="https://github.com/scripting/tweetFeedSupport"
  xmlns:ap="https://www.w3.org/TR/activitypub/">
  <channel>
    <title><%= @user.nickname <> "'s timeline" %></title>
    <description>Publicly visible items published by <%= @user.nickname %></description>
    <link><%= Routes.user_feed_url(@conn, :feed, @user.nickname) <> ".rss" %></link>
    <lastBuildDate><%= most_recent_update(@activities, @user, "{RFC822z}") %></lastBuildDate>
    <image>
      <link><%= logo(@user) %></link>
      <title><%= @user.nickname <> "'s avatar" %></title>
      <url><%= logo(@user) %></url>
    </image>

    <%= render @view_module, "_author.rss", assigns %>

    <%= if last_activity(@activities) do %>
      <atom:link rel="next" href="<%= Routes.user_feed_url(@conn, :feed, @user.nickname) <> ".rss?max_id=#{last_activity(@activities).id}" %>"/>
    <% end %>
    <%= for activity <- @activities do %>
    <%= render @view_module, "_activity.rss", Map.merge(assigns, prepare_activity(activity)) %>
    <% end %>
  </channel>
</rss>
