summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/templates/feed/feed/_activity.rss.eex
blob: 279f2171d811a491ed133edd9713c9df5bda54ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<item>
  <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
  <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
  <guid><%= @data["id"] %></guid>
  <title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
  <description><%= activity_content(@data) %></description>
  <pubDate><%= @activity.data["published"] %></pubDate>
  <updated><%= @activity.data["published"] %></updated>
  <ostatus:conversation ref="<%= activity_context(@activity) %>">
    <%= activity_context(@activity) %>
  </ostatus:conversation>

  <%= if @data["summary"] do %>
    <description><%= escape(@data["summary"]) %></description>
  <% end %>

  <%= if @activity.local do %>
    <link><%= @data["id"] %></link>
  <% else %>
    <link><%= @data["external_url"] %></link>
  <% end %>

  <link rel="ostatus:conversation"><%= activity_context(@activity) %></link>

  <%= for tag <- Pleroma.Object.hashtags(@object) do %>
    <category term="<%= tag %>"></category>
  <% end %>

  <%= for attachment <- @data["attachment"] || [] do %>
    <link type="<%= attachment_type(attachment) %>"><%= attachment_href(attachment) %></link>
  <% end %>

  <%= if @data["inReplyTo"] do %>
    <thr:in-reply-to ref='<%= @data["inReplyTo"] %>' href='<%= get_href(@data["inReplyTo"]) %>'/>
  <% 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">http://activityschema.org/collection/public</link>
    <% 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"><%= id %></link>
      <% end %>
    <% end %>
  <% end %>

  <%= for {emoji, file} <- @data["emoji"] || %{} do %>
    <link name="<%= emoji %>" rel="emoji"><%= file %></link>
  <% end %>
</item>