aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/activity_pub/side_effects.ex
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-04-23 02:03:02 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-04-23 02:03:02 +0300
commit416a37fcefbd38d01a46b15e6af039b99a22ee0b (patch)
tree3c3c4506ad41fb227411facc37e1581ab29d8f25 /lib/pleroma/web/activity_pub/side_effects.ex
parent8b522b3b3fead67e6d1c017b79758c12e3b133af (diff)
parent850377a7b8d380088d8717d82b09a2976bbdd739 (diff)
downloadpleroma-416a37fcefbd38d01a46b15e6af039b99a22ee0b.tar.gz
Merge branch 'develop' into refactor/fe-bundles
Diffstat (limited to 'lib/pleroma/web/activity_pub/side_effects.ex')
-rw-r--r--lib/pleroma/web/activity_pub/side_effects.ex13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex
index 6a8f1af96..5981e7545 100644
--- a/lib/pleroma/web/activity_pub/side_effects.ex
+++ b/lib/pleroma/web/activity_pub/side_effects.ex
@@ -15,12 +15,17 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
# - Add like to object
# - Set up notification
def handle(%{data: %{"type" => "Like"}} = object, meta) do
- liked_object = Object.get_by_ap_id(object.data["object"])
- Utils.add_like_to_object(object, liked_object)
+ {:ok, result} =
+ Pleroma.Repo.transaction(fn ->
+ 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)
+
+ result
end
# Nothing to do