reports: unify sending e-mail for both remote and local reports
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 7d21fe65f7ff4c0ee588495cd1328a7dcba8daf3..32f69e0fa6f0380b1ca23c8a1fc5a25a9f08a6a5 100644 (file)
@@ -394,6 +394,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     with flag_data <- make_flag_data(params, additional),
          {:ok, activity} <- insert(flag_data, local),
          :ok <- maybe_federate(activity) do
+      Enum.each(User.all_superusers(), fn superuser ->
+        superuser
+        |> Pleroma.AdminEmail.report(actor, account, statuses, content)
+        |> Pleroma.Mailer.deliver_async()
+      end)
+
       {:ok, activity}
     end
   end