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 @@ def flag(
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 @@ def report(user, data) 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}