diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-02-06 21:19:35 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-02-09 14:59:21 +0100 |
commit | d2e4eb7c748c918b1e9e7133fef4c1b84cf66755 (patch) | |
tree | 8bcb89d26d06317e925427d336a8f2dfd1946f99 | |
parent | bd9b5fffbcffed5d5cab238d5f3c36cf90edc881 (diff) | |
download | pleroma-d2e4eb7c748c918b1e9e7133fef4c1b84cf66755.tar.gz |
Web.ActivityPub.ActivityPub: assign the Enum.filter to recipients & simplify it
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 6028e96a9..d22f04bb2 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -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 - - user -> - User.following?(user, actor) - end - end) + 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) {recipients, to, cc} end |