From: rinpatch Date: Thu, 14 Mar 2019 17:49:00 +0000 (+0000) Subject: Merge branch 'hotfix/delete-activities' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=34fc0dca2e879bcbb73acc80fdc72678411d0ebf;p=akkoma Merge branch 'hotfix/delete-activities' into 'develop' Fix delete activities not federating See merge request pleroma/pleroma!933 --- 34fc0dca2e879bcbb73acc80fdc72678411d0ebf diff --cc lib/pleroma/web/activity_pub/activity_pub.ex index d5b03cd24,96b774c21..70db419ca --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@@ -310,19 -309,18 +310,19 @@@ defmodule Pleroma.Web.ActivityPub.Activ def delete(%Object{data: %{"id" => id, "actor" => actor}} = object, local \\ true) do user = User.get_cached_by_ap_id(actor) - to = object.data["to"] || [] ++ object.data["cc"] || [] + 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 + # 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), :ok <- maybe_federate(activity) do {:ok, activity}