3f0783c0a5
Changes: - make the XML closer to spec (RSS does not pass w3c's validator, but works) - fix dates (RFC3339 for Atom, doc says RFC822 for RSS but RFC1123 is closer) - fix attachment/enclosure links (but see below) - set feed item title to post's "summary" if present - pruned several elements that validators did not like - examples: ap_enabled, user banner urls. Specs: - https://www.rssboard.org/rss-specification - https://validator.w3.org/feed/docs/atom.html - https://www.intertwingly.net/wiki/pie/Rss20AndAtom10Compared Validators: - https://validator.w3.org/feed/ - https://rssatom.com/feedvalidator.php Attachment/enclosure links should have a "length" field (mandatory according to the spec). This is not present in the object's data map.
50 lines
1.9 KiB
Elixir
50 lines
1.9 KiB
Elixir
<entry>
|
|
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
|
|
<%= render Phoenix.Controller.view_module(@conn), "_tag_author.atom", assigns %>
|
|
|
|
<id><%= @data["id"] %></id>
|
|
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
|
<content type="html"><%= activity_description(@data) %></content>
|
|
<published><%= to_rfc3339(@activity.data["published"]) %></published>
|
|
<updated><%= to_rfc3339(@activity.data["published"]) %></updated>
|
|
<ostatus:conversation ref="<%= activity_context(@activity) %>">
|
|
<%= activity_context(@activity) %>
|
|
</ostatus:conversation>
|
|
<link href="<%= activity_context(@activity) %>" rel="ostatus:conversation"/>
|
|
|
|
<%= if @data["summary"] != "" do %>
|
|
<summary><%= @data["summary"] %></summary>
|
|
<% end %>
|
|
|
|
<%= if @activity.local do %>
|
|
<link type="application/atom+xml" href='<%= @data["id"] %>' rel="self"/>
|
|
<link type="text/html" href='<%= @data["id"] %>' rel="alternate"/>
|
|
<% else %>
|
|
<link type="text/html" href='<%= @data["external_url"] %>' rel="alternate"/>
|
|
<% end %>
|
|
|
|
<%= for id <- @activity.recipients do %>
|
|
<%= if id == Pleroma.Constants.as_public() do %>
|
|
<link rel="mentioned"
|
|
ostatus:object-type="http://activitystrea.ms/schema/1.0/collection"
|
|
href="http://activityschema.org/collection/public"/>
|
|
<% else %>
|
|
<%= unless Regex.match?(~r/^#{Pleroma.Web.Endpoint.url()}.+followers$/, id) do %>
|
|
<link rel="mentioned"
|
|
ostatus:object-type="http://activitystrea.ms/schema/1.0/person"
|
|
href="<%= id %>" />
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
|
<category term="<%= tag %>"></category>
|
|
<% end %>
|
|
|
|
<%= for {emoji, file} <- @data["emoji"] || %{} do %>
|
|
<link name="<%= emoji %>" rel="emoji" href="<%= file %>"/>
|
|
<% end %>
|
|
</entry>
|