diff options
Diffstat (limited to 'lib/pleroma/web/activity_pub/side_effects.ex')
-rw-r--r-- | lib/pleroma/web/activity_pub/side_effects.ex | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex index b997c15db..ce0f61da2 100644 --- a/lib/pleroma/web/activity_pub/side_effects.ex +++ b/lib/pleroma/web/activity_pub/side_effects.ex @@ -234,6 +234,18 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do end end + # Tasks this handles + # - Actually create object + # - Rollback if we couldn't create it + @impl true + def handle(%{data: %{"type" => "Listen"}} = activity, meta) do + with {:ok, _object, meta} <- handle_object_creation(meta[:object_data], activity, meta) do + {:ok, activity, meta} + else + e -> Repo.rollback(e) + end + end + # Tasks this handles: # - Add announce to object # - Set up notification |