forked from AkkomaGang/akkoma
Web.ActivityPub.ActivityPub: assign the Enum.filter to recipients & simplify it
This commit is contained in:
parent
bd9b5fffbc
commit
d2e4eb7c74
1 changed files with 10 additions and 10 deletions
|
@ -19,19 +19,19 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
defp get_recipients(%{"type" => "Announce"} = data) do
|
||||
to = data["to"] || []
|
||||
cc = data["cc"] || []
|
||||
recipients = to ++ cc
|
||||
actor = User.get_cached_by_ap_id(data["actor"])
|
||||
|
||||
recipients
|
||||
|> Enum.filter(fn recipient ->
|
||||
case User.get_cached_by_ap_id(recipient) do
|
||||
nil ->
|
||||
true
|
||||
recipients =
|
||||
(to ++ cc)
|
||||
|> Enum.filter(fn recipient ->
|
||||
case User.get_cached_by_ap_id(recipient) do
|
||||
nil ->
|
||||
true
|
||||
|
||||
user ->
|
||||
User.following?(user, actor)
|
||||
end
|
||||
end)
|
||||
user ->
|
||||
User.following?(user, actor)
|
||||
end
|
||||
end)
|
||||
|
||||
{recipients, to, cc}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue