reports: unify sending e-mail for both remote and local reports

This commit is contained in:
William Pitcock 2019-03-14 19:38:46 +00:00
parent 64b0120d67
commit 5c7b774f09
2 changed files with 6 additions and 6 deletions

View 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

View file

@ -287,12 +287,6 @@ defmodule Pleroma.Web.CommonAPI do
content: content_html,
forward: data["forward"] || false
}) do
Enum.each(User.all_superusers(), fn superuser ->
superuser
|> Pleroma.AdminEmail.report(user, account, statuses, content_html)
|> Pleroma.Mailer.deliver_async()
end)
{:ok, activity}
else
{:error, err} -> {:error, err}