ActivityPub: Fix deletes being exempt from MRF

Closes #1461
This commit is contained in:
rinpatch 2019-12-05 02:50:38 +03:00
commit 9f99640cfc
7 changed files with 32 additions and 6 deletions

View file

@ -241,9 +241,10 @@ defmodule Pleroma.Activity do
def normalize(ap_id) when is_binary(ap_id), do: get_by_ap_id_with_object(ap_id)
def normalize(_), do: nil
def delete_by_ap_id(id) when is_binary(id) do
def delete_all_by_object_ap_id(id) when is_binary(id) do
id
|> Queries.by_object_id()
|> Queries.exclude_type("Delete")
|> select([u], u)
|> Repo.delete_all()
|> elem(1)
@ -255,7 +256,7 @@ defmodule Pleroma.Activity do
|> purge_web_resp_cache()
end
def delete_by_ap_id(_), do: nil
def delete_all_by_object_ap_id(_), do: nil
defp purge_web_resp_cache(%Activity{} = activity) do
%{path: path} = URI.parse(activity.data["id"])