1 defmodule Pleroma.Web.ActivityPub.SideEffects do
3 This module looks at an inserted object and executes the side effects that it
4 implies. For example, a `Like` activity will increase the like count on the
5 liked object, a `Follow` activity will add the user to the follower
8 alias Pleroma.Notification
10 alias Pleroma.Web.ActivityPub.Utils
12 def handle(object, meta \\ [])
15 # - Add like to object
16 # - Set up notification
17 def handle(%{data: %{"type" => "Like"}} = object, meta) do
18 liked_object = Object.get_by_ap_id(object.data["object"])
19 Utils.add_like_to_object(object, liked_object)
20 Notification.create_notifications(object)
25 def handle(object, meta) do