forked from AkkomaGang/akkoma
reports: unify sending e-mail for both remote and local reports
This commit is contained in:
parent
64b0120d67
commit
5c7b774f09
2 changed files with 6 additions and 6 deletions
|
@ -394,6 +394,12 @@ def flag(
|
||||||
with flag_data <- make_flag_data(params, additional),
|
with flag_data <- make_flag_data(params, additional),
|
||||||
{:ok, activity} <- insert(flag_data, local),
|
{:ok, activity} <- insert(flag_data, local),
|
||||||
:ok <- maybe_federate(activity) do
|
: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}
|
{:ok, activity}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -287,12 +287,6 @@ def report(user, data) do
|
||||||
content: content_html,
|
content: content_html,
|
||||||
forward: data["forward"] || false
|
forward: data["forward"] || false
|
||||||
}) do
|
}) do
|
||||||
Enum.each(User.all_superusers(), fn superuser ->
|
|
||||||
superuser
|
|
||||||
|> Pleroma.AdminEmail.report(user, account, statuses, content_html)
|
|
||||||
|> Pleroma.Mailer.deliver_async()
|
|
||||||
end)
|
|
||||||
|
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
else
|
else
|
||||||
{:error, err} -> {:error, err}
|
{:error, err} -> {:error, err}
|
||||||
|
|
Loading…
Reference in a new issue