Add Activity Pub endpoints cache

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-03-01 18:30:46 +01:00
parent b3a3001e90
commit a3ffc08e57
6 changed files with 104 additions and 43 deletions

View File

@@ -72,11 +72,10 @@ defmodule Mobilizon.Service.Feed do
defp get_entry(%Event{} = event) do
with {:ok, html, []} <- Earmark.as_html(event.description) do
entry =
Entry.new(event.url, event.inserted_at, event.title)
Entry.new(event.url, event.publish_at || event.inserted_at, event.title)
|> Entry.link(event.url, rel: "alternate", type: "text/html")
|> Entry.content({:cdata, html}, type: "html")
entry = if event.publish_at, do: Entry.published(entry, event.publish_at), else: entry
|> Entry.published(event.publish_at || event.inserted_at)
# Add tags
entry =