summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/templates/feed/feed/_activity.atom.eex
blob: 57bd9246836434d0bd5dc1524ce589ebbb49360a (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
<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>
  <id><%= @data["id"] %></id>
  <title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
  <content type="html"><%= activity_content(@data) %></content>
  <published><%= @activity.data["published"] %></published>
  <updated><%= @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><%= escape(@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 tag <- Pleroma.Object.hashtags(@object) do %>
    <category term="<%= tag %>"></category>
  <% end %>

  <%= for attachment <- @data["attachment"] || [] do %>
    <link rel="enclosure" href="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/>
  <% 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" 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 {emoji, file} <- @data["emoji"] || %{} do %>
    <link name="<%= emoji %>" rel="emoji" href="<%= file %>"/>
  <% end %>
</entry>