fix(feed): complete Atom XML metadata

This commit is contained in:
Lain Soykaf 2026-07-24 21:04:35 +04:00
commit c5230d98c5
No known key found for this signature in database
6 changed files with 75 additions and 4 deletions

View file

@ -43,7 +43,7 @@ defmodule Pleroma.Web.Feed.FeedView do
def most_recent_update(activities, :rss) do
activities
|> Enum.map(fn activity ->
case Object.normalize(activity, fetch: false) do
case activity.object do
%Object{updated_at: updated_at} -> updated_at
_ -> activity.updated_at
end

View file

@ -1,7 +1,7 @@
<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>
<id><%= escape(@data["id"] || "") %></id>
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
<content type="html"><%= escape(atom_content_encoded(@data)) %></content>
<published><%= to_rfc3339(@data["published"]) %></published>

View file

@ -4,7 +4,7 @@
<%= render Phoenix.Controller.view_module(@conn), "_tag_author.atom", assigns %>
<id><%= @data["id"] %></id>
<id><%= escape(@data["id"] || "") %></id>
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
<content type="html"><%= escape(atom_content_encoded(@data)) %></content>
<published><%= to_rfc3339(@data["published"]) %></published>

View file

@ -13,7 +13,7 @@
<subtitle><%= subtitle %></subtitle>
<% end %>
<logo><%= feed_logo() %></logo>
<updated><%= most_recent_update(@activities) %></updated>
<updated><%= most_recent_update(@activities) || to_rfc3339(NaiveDateTime.utc_now()) %></updated>
<link rel="self" href="<%= feed_self_url(@conn) %>" type="application/atom+xml"/>
<%= for activity <- @activities do %>