Extract RSS Feed functionality from OStatus
[akkoma] / lib / pleroma / web / templates / feed / feed / _activity.xml.eex
1 <entry>
2 <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
3 <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
4 <id><%= @data["id"] %></id>
5 <title><%= "New note by #{@user.nickname}" %></title>
6 <content type="html"><%= activity_content(@activity) %></content>
7 <published><%= @data["published"] %></published>
8 <updated><%= @data["published"] %></updated>
9 <ostatus:conversation ref="<%= activity_context(@activity) %>"><%= activity_context(@activity) %></ostatus:conversation>
10 <link ref="<%= activity_context(@activity) %>" rel="ostatus:conversation"/>
11
12 <%= if @data["summary"] do %>
13 <summary><%= @data["summary"] %></summary>
14 <% end %>
15
16 <%= if @activity.local do %>
17 <link type="application/atom+xml" href='<%= @data["id"] %>' rel="self"/>
18 <link type="text/html" href='<%= @data["id"] %>' rel="alternate"/>
19 <% else %>
20 <link type="text/html" href='<%= @data["external_url"] %>' rel="alternate"/>
21 <% end %>
22
23 <%= for tag <- @data["tag"] || [] do %>
24 <category term="<%= tag %>"></category>
25 <% end %>
26
27 <%= for attachment <- @data["attachment"] || [] do %>
28 <link rel="enclosure" href="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/>
29 <% end %>
30
31 <%= if @data["inReplyTo"] do %>
32 <thr:in-reply-to ref='<%= @data["inReplyTo"] %>' href='<%= get_href(@data["inReplyTo"]) %>'/>
33 <% end %>
34
35 <%= for id <- @activity.recipients do %>
36 <%= if id == Pleroma.Constants.as_public() do %>
37 <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
38 <% else %>
39 <%= unless Regex.match?(~r/^#{Pleroma.Web.base_url()}.+followers$/, id) do %>
40 <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="<%= id %>"/>
41 <% end %>
42 <% end %>
43 <% end %>
44
45 <%= for {emoji, file} <- @data["emoji"] || %{} do %>
46 <link name="<%= emoji %>" rel="emoji" href="<%= file %>"/>
47 <% end %>
48 </entry>