Create Question: Add context field to create
This commit is contained in:
parent
922ca23298
commit
e4beff90f5
4 changed files with 42 additions and 1 deletions
|
|
@ -80,6 +80,13 @@ defmodule Pleroma.Web.ActivityPub.Builder do
|
|||
end
|
||||
|
||||
def create(actor, object, recipients) do
|
||||
context =
|
||||
if is_map(object) do
|
||||
object["context"]
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
||||
{:ok,
|
||||
%{
|
||||
"id" => Utils.generate_activity_id(),
|
||||
|
|
@ -88,7 +95,8 @@ defmodule Pleroma.Web.ActivityPub.Builder do
|
|||
"object" => object,
|
||||
"type" => "Create",
|
||||
"published" => DateTime.utc_now() |> DateTime.to_iso8601()
|
||||
}, []}
|
||||
}
|
||||
|> Pleroma.Maps.put_if_present("context", context), []}
|
||||
end
|
||||
|
||||
def chat_message(actor, recipient, content, opts \\ []) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue