Verified Commit d2e4eb7c authored by Haelwenn's avatar Haelwenn

Web.ActivityPub.ActivityPub: assign the Enum.filter to recipients & simplify it

parent bd9b5fff
...@@ -19,10 +19,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do ...@@ -19,10 +19,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
defp get_recipients(%{"type" => "Announce"} = data) do defp get_recipients(%{"type" => "Announce"} = data) do
to = data["to"] || [] to = data["to"] || []
cc = data["cc"] || [] cc = data["cc"] || []
recipients = to ++ cc
actor = User.get_cached_by_ap_id(data["actor"]) actor = User.get_cached_by_ap_id(data["actor"])
recipients recipients =
(to ++ cc)
|> Enum.filter(fn recipient -> |> Enum.filter(fn recipient ->
case User.get_cached_by_ap_id(recipient) do case User.get_cached_by_ap_id(recipient) do
nil -> nil ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment