diff options
author | rinpatch <rinpatch@sdf.org> | 2021-02-08 10:31:20 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2021-02-08 10:31:20 +0000 |
commit | 8babd796da46975c2d976cf87dad844c13e8a69e (patch) | |
tree | 82425003f80c949d545bfb7b2d3db3d948c896cf /lib | |
parent | 6e68058b634dced932a1283f8470598b5cabdfeb (diff) | |
parent | d04737229196a08db4bc726f8afd55a64dcf8304 (diff) | |
download | pleroma-8babd796da46975c2d976cf87dad844c13e8a69e.tar.gz |
Merge branch 'fix/reports-from-admins' into 'develop'
Suppress report notification for admin actors
See merge request pleroma/pleroma!3301
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/notification.ex | 4 | ||||
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 55b513212..1970fbf65 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -507,8 +507,8 @@ defmodule Pleroma.Notification do [object_id] end - def get_potential_receiver_ap_ids(%{data: %{"type" => "Flag"}}) do - User.all_superusers() |> Enum.map(fn user -> user.ap_id end) + def get_potential_receiver_ap_ids(%{data: %{"type" => "Flag", "actor" => actor}}) do + (User.all_superusers() |> Enum.map(fn user -> user.ap_id end)) -- [actor] end def get_potential_receiver_ap_ids(activity) do diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 1a84375fb..5b45e2ca1 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -377,6 +377,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do :ok <- maybe_federate(stripped_activity) do User.all_superusers() + |> Enum.filter(fn user -> user.ap_id != actor end) |> Enum.filter(fn user -> not is_nil(user.email) end) |> Enum.each(fn superuser -> superuser |