mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 15:14:42 +00:00
Don't delete new delete activity...
This commit is contained in:
parent
fcf3128a56
commit
3438a120cc
2 changed files with 6 additions and 4 deletions
|
@ -83,11 +83,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
"object" => id,
|
"object" => id,
|
||||||
"to" => [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
|
"to" => [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
|
||||||
}
|
}
|
||||||
with {:ok, activity} <- insert(data, local),
|
with 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)),
|
||||||
|
{:ok, activity} <- insert(data, local),
|
||||||
:ok <- maybe_federate(activity) do
|
:ok <- maybe_federate(activity) 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))
|
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -256,6 +256,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
||||||
assert delete.data["actor"] == note.data["actor"]
|
assert delete.data["actor"] == note.data["actor"]
|
||||||
assert delete.data["object"] == note.data["object"]["id"]
|
assert delete.data["object"] == note.data["object"]["id"]
|
||||||
|
|
||||||
|
assert Repo.get(Activity, delete.id) != nil
|
||||||
|
|
||||||
assert Repo.get(Object, object.id) == nil
|
assert Repo.get(Object, object.id) == nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue