forked from AkkomaGang/akkoma
AcitvityPub: Outgoing Announces.
This commit is contained in:
parent
32b995fbb6
commit
0f2ad25a7b
2 changed files with 2 additions and 1 deletions
|
@ -96,7 +96,7 @@ def prepare_outgoing(%{"type" => "Create", "object" => %{"type" => "Note"} = obj
|
||||||
{:ok, data}
|
{:ok, data}
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepare_outgoing(%{"type" => type} = data) when type in ["Follow", "Accept", "Like"] do
|
def prepare_outgoing(%{"type" => type} = data) when type in ["Follow", "Accept", "Like", "Announce"] do
|
||||||
data = data
|
data = data
|
||||||
|> Map.put("@context", "https://www.w3.org/ns/activitystreams")
|
|> Map.put("@context", "https://www.w3.org/ns/activitystreams")
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ def render("object.json", %{object: object}) do
|
||||||
}
|
}
|
||||||
|
|
||||||
additional = Map.take(object.data, ["id", "to", "cc", "actor", "content", "summary", "type"])
|
additional = Map.take(object.data, ["id", "to", "cc", "actor", "content", "summary", "type"])
|
||||||
|
|> Map.put("attributedTo", object.data["actor"])
|
||||||
Map.merge(base, additional)
|
Map.merge(base, additional)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue