Fix deletion not deleting relevant actions.
This commit is contained in:
parent
2ab1d915e3
commit
552cfdbe11
3 changed files with 12 additions and 0 deletions
|
|
@ -15,11 +15,17 @@ defmodule Pleroma.Activity do
|
|||
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)))
|
||||
end
|
||||
|
||||
# Wrong name, only returns create activities
|
||||
def all_by_object_ap_id_q(ap_id) do
|
||||
from activity in Activity,
|
||||
where: fragment("(?)->'object'->>'id' = ?", activity.data, ^to_string(ap_id))
|
||||
end
|
||||
|
||||
def all_non_create_by_object_ap_id_q(ap_id) do
|
||||
from activity in Activity,
|
||||
where: fragment("(?)->>'object' = ?", activity.data, ^to_string(ap_id))
|
||||
end
|
||||
|
||||
def all_by_object_ap_id(ap_id) do
|
||||
Repo.all(all_by_object_ap_id_q(ap_id))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ defmodule Pleroma.Web.OStatus.DeleteHandler do
|
|||
with id <- XML.string_from_xpath("//id", entry),
|
||||
object when not is_nil(object) <- Object.get_by_ap_id(id) do
|
||||
Repo.delete(object)
|
||||
Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id))
|
||||
Repo.delete_all(Activity.all_by_object_ap_id_q(id))
|
||||
nil
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue