mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 15:05:45 +00:00
SideEffects: Use less cryptic syntax.
This commit is contained in:
parent
e62173dfc8
commit
1bcbdc7a9f
|
@ -15,15 +15,17 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
||||||
# - Add like to object
|
# - Add like to object
|
||||||
# - Set up notification
|
# - Set up notification
|
||||||
def handle(%{data: %{"type" => "Like"}} = object, meta) do
|
def handle(%{data: %{"type" => "Like"}} = object, meta) do
|
||||||
Pleroma.Repo.transaction(fn ->
|
{:ok, result} =
|
||||||
liked_object = Object.get_by_ap_id(object.data["object"])
|
Pleroma.Repo.transaction(fn ->
|
||||||
Utils.add_like_to_object(object, liked_object)
|
liked_object = Object.get_by_ap_id(object.data["object"])
|
||||||
|
Utils.add_like_to_object(object, liked_object)
|
||||||
|
|
||||||
Notification.create_notifications(object)
|
Notification.create_notifications(object)
|
||||||
|
|
||||||
{:ok, object, meta}
|
{:ok, object, meta}
|
||||||
end)
|
end)
|
||||||
|> (fn {:ok, res} -> res end).()
|
|
||||||
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
# Nothing to do
|
# Nothing to do
|
||||||
|
|
Loading…
Reference in a new issue