mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-24 07:16:18 +00:00
15 lines
418 B
Elixir
15 lines
418 B
Elixir
defmodule Pleroma.Web.OStatus.DeleteHandler do
|
|
require Logger
|
|
alias Pleroma.Web.{XML, OStatus}
|
|
alias Pleroma.{Activity, Object, Repo}
|
|
|
|
def handle_delete(entry, doc \\ nil) 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_by_object_ap_id_q(id))
|
|
nil
|
|
end
|
|
end
|
|
end
|