SideEffects: port ones from ActivityPub.do_create and ActivityPub.insert

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-06-18 04:05:42 +02:00
commit 82895a4012
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
13 changed files with 188 additions and 73 deletions

View file

@ -115,6 +115,21 @@ defmodule Pleroma.Web.ActivityPub.Builder do
end
end
def answer(user, object, name) do
{:ok,
%{
"type" => "Answer",
"actor" => user.ap_id,
"cc" => [object.data["actor"]],
"to" => [],
"name" => name,
"inReplyTo" => object.data["id"],
"context" => object.data["context"],
"published" => DateTime.utc_now() |> DateTime.to_iso8601(),
"id" => Utils.generate_object_id()
}, []}
end
@spec tombstone(String.t(), String.t()) :: {:ok, map(), keyword()}
def tombstone(actor, id) do
{:ok,