X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Fside_effects.ex;h=bfc2ab845d7aac444c7ce8b8a563e768a6f3cfd9;hb=a42a0716ec769dfbd97505b6c872c5ea1a8f800a;hp=5049cb54ea2804ce21fd11854c366c3f2965f7d5;hpb=b078e0567dbecc768f88d991a2565141eb9e8c50;p=akkoma diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex index 5049cb54e..bfc2ab845 100644 --- a/lib/pleroma/web/activity_pub/side_effects.ex +++ b/lib/pleroma/web/activity_pub/side_effects.ex @@ -34,6 +34,18 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do end end + # Tasks this handles: + # - Add reaction to object + # - Set up notification + def handle(%{data: %{"type" => "EmojiReact"}} = object, meta) do + reacted_object = Object.get_by_ap_id(object.data["object"]) + Utils.add_emoji_reaction_to_object(object, reacted_object) + + Notification.create_notifications(object) + + {:ok, object, meta} + end + # Tasks this handles: # - Delete and unpins the create activity # - Replace object with Tombstone