Broadcast deleted activity id on deletion to conform to MastoAPI streamig spec
This commit is contained in:
parent
5075e8abe5
commit
6038c8a753
6 changed files with 40 additions and 14 deletions
|
|
@ -311,14 +311,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
user = User.get_cached_by_ap_id(actor)
|
||||
to = object.data["to"] || [] ++ object.data["cc"] || []
|
||||
|
||||
data = %{
|
||||
"type" => "Delete",
|
||||
"actor" => actor,
|
||||
"object" => id,
|
||||
"to" => to
|
||||
}
|
||||
|
||||
with {:ok, _} <- Object.delete(object),
|
||||
with {:ok, object, activity} <- Object.delete(object),
|
||||
data <- %{
|
||||
"type" => "Delete",
|
||||
"actor" => actor,
|
||||
"object" => id,
|
||||
"to" => to,
|
||||
"deleted_activity_id" => activity && activity.id
|
||||
},
|
||||
{:ok, activity} <- insert(data, local),
|
||||
# Changing note count prior to enqueuing federation task in order to avoid race conditions on updating user.info
|
||||
{:ok, _actor} <- decrease_note_count_if_public(user, object),
|
||||
|
|
|
|||
|
|
@ -736,6 +736,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
def prepare_outgoing(%{"type" => _type} = data) do
|
||||
data =
|
||||
data
|
||||
|> strip_internal_fields
|
||||
|> maybe_fix_object_url
|
||||
|> Map.merge(Utils.make_json_ld_header())
|
||||
|
||||
|
|
@ -870,7 +871,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
"announcements",
|
||||
"announcement_count",
|
||||
"emoji",
|
||||
"context_id"
|
||||
"context_id",
|
||||
"deleted_activity_id"
|
||||
])
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue