SideEffects: Stream out deletes.
authorlain <lain@soykaf.club>
Thu, 30 Apr 2020 15:58:09 +0000 (17:58 +0200)
committerlain <lain@soykaf.club>
Thu, 30 Apr 2020 15:58:09 +0000 (17:58 +0200)
lib/pleroma/web/activity_pub/side_effects.ex

index ef58fa39944b241a211ed54c870f510daa3d2d25..d260e00698428f58faf04b78e3b1068c3a8fd23f 100644 (file)
@@ -9,6 +9,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
   alias Pleroma.Object
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.Utils
+  alias Pleroma.Web.ActivityPub.ActivityPub
 
   def handle(object, meta \\ [])
 
@@ -40,9 +41,12 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
     result =
       case deleted_object do
         %Object{} ->
-          with {:ok, _, activity} <- Object.delete(deleted_object),
+          with {:ok, deleted_object, activity} <- Object.delete(deleted_object),
                %User{} = user <- User.get_cached_by_ap_id(deleted_object.data["actor"]) do
             User.remove_pinnned_activity(user, activity)
+
+            ActivityPub.stream_out(object)
+            ActivityPub.stream_out_participations(deleted_object, user)
             :ok
           end