ensure we can't have a null in appends

This commit is contained in:
FloatingGhost 2023-03-11 17:24:49 +00:00
parent 9977588612
commit 5ca22c2459

View file

@ -227,8 +227,10 @@ def render("show.json", %{activity: %{data: %{"object" => _object}} = activity}
|> Enum.filter(fn tag -> is_map(tag) and tag["type"] == "Mention" end)
|> Enum.map(fn tag -> tag["href"] end)
to_data = if is_nil(object.data["to"]), do: [], else: object.data["to"]
mentions =
(object.data["to"] ++ tag_mentions)
(to_data ++ tag_mentions)
|> Enum.uniq()
|> Enum.map(fn
Pleroma.Constants.as_public() -> nil