Exclude reporter from receiving notifications from their own reports.
Currently only works if the reporting actor is an admin, but if we include moderators with those who receive notification reports it will work for them.
This commit is contained in:
parent
a7864a9429
commit
76f732766b
|
@ -507,8 +507,8 @@ def get_potential_receiver_ap_ids(%{data: %{"type" => "Follow", "object" => obje
|
||||||
[object_id]
|
[object_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_potential_receiver_ap_ids(%{data: %{"type" => "Flag"}}) do
|
def get_potential_receiver_ap_ids(%{data: %{"type" => "Flag", "actor" => actor}}) do
|
||||||
User.all_superusers() |> Enum.map(fn user -> user.ap_id end)
|
(User.all_superusers() |> Enum.map(fn user -> user.ap_id end)) -- [actor]
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_potential_receiver_ap_ids(activity) do
|
def get_potential_receiver_ap_ids(activity) do
|
||||||
|
|
|
@ -377,6 +377,7 @@ defp do_flag(
|
||||||
:ok <-
|
:ok <-
|
||||||
maybe_federate(stripped_activity) do
|
maybe_federate(stripped_activity) do
|
||||||
User.all_superusers()
|
User.all_superusers()
|
||||||
|
|> Enum.filter(fn user -> user.ap_id != actor end)
|
||||||
|> Enum.filter(fn user -> not is_nil(user.email) end)
|
|> Enum.filter(fn user -> not is_nil(user.email) end)
|
||||||
|> Enum.each(fn superuser ->
|
|> Enum.each(fn superuser ->
|
||||||
superuser
|
superuser
|
||||||
|
|
Loading…
Reference in a new issue