diff options
author | lain <lain@soykaf.club> | 2019-10-03 18:37:23 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-10-03 18:37:23 +0200 |
commit | c9043c6c808129f4f6236d03bf05e5a46f0c6e14 (patch) | |
tree | 8c6e92b047367f8ac288ae224b16d0be930f6365 /lib | |
parent | 0e41951eab405ea5a3016bbb0897eba4aa7c6a0b (diff) | |
download | pleroma-c9043c6c808129f4f6236d03bf05e5a46f0c6e14.tar.gz |
Transmogrifier: Handle incoming Undos for EmojiReactions.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index cb868c336..ea209b5ea 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -724,6 +724,28 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do def handle_incoming( %{ "type" => "Undo", + "object" => %{"type" => "EmojiReaction", "id" => reaction_activity_id}, + "actor" => _actor, + "id" => id + } = data, + _options + ) do + with actor <- Containment.get_actor(data), + {:ok, %User{} = actor} <- User.get_or_fetch_by_ap_id(actor), + {:ok, activity, _} <- + ActivityPub.unreact_with_emoji(actor, reaction_activity_id, + activity_id: id, + local: false + ) do + {:ok, activity} + else + _e -> :error + end + end + + def handle_incoming( + %{ + "type" => "Undo", "object" => %{"type" => "Block", "object" => blocked}, "actor" => blocker, "id" => id |