AP C2S: Set published date

This commit is contained in:
Haelwenn (lanodan) Monnier 2021-07-28 00:53:43 +02:00
parent c97f99ccf2
commit 1054b29ebd
1 changed files with 2 additions and 0 deletions

View File

@ -416,6 +416,7 @@ defp fix_user_message(%User{ap_id: actor}, %{"type" => "Create", "object" => obj
|> Map.put("attributedTo", actor)
|> Map.put("actor", actor)
|> Map.put("id", Utils.generate_object_id())
|> Map.put("published", Utils.make_date())
{:ok, Map.put(activity, "object", object)}
else
@ -458,6 +459,7 @@ def update_outbox(
|> Map.drop(["nickname"])
|> Map.put("id", Utils.generate_activity_id())
|> Map.put("actor", actor)
|> Map.put("published", Utils.make_date())
with {:ok, params} <- fix_user_message(user, params),
{:ok, activity, _} <- Pipeline.common_pipeline(params, local: true),