Add tag timelines.
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index cc5c0e9b67aa9c416c2f6d3caa9c6cc75fbfba83..e561b32fe929f337ab33f071cf79ff8701c2fd34 100644 (file)
@@ -27,7 +27,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     attachments = render_many(object["attachment"] || [], StatusView, "attachment.json", as: :attachment)
 
     created_at = (object["published"] || "")
-    |> String.replace(~r/\.\d+/, "")
+    |> NaiveDateTime.from_iso8601!
+    |> NaiveDateTime.to_iso8601
+    |> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
 
     %{
       id: activity.id,
@@ -50,7 +52,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       media_attachments: attachments,
       mentions: mentions,
       tags: [], # fix,
-      application: nil,
+      application: %{
+        name: "Web",
+        website: nil
+      },
       language: nil
     }
   end
@@ -71,6 +76,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       url: href,
       remote_url: href,
       preview_url: href,
+      text_url: href,
       type: type
     }
   end