diff options
author | kaniini <ariadne@dereferenced.org> | 2019-09-30 16:37:45 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-09-30 16:37:45 +0000 |
commit | 57101955b681b13dfc318d3210a0b59cc377cd8b (patch) | |
tree | 6d021061c9ae7458726af5b5785d9ba69b176962 /lib | |
parent | 56c91d1323ac354c89aa9fa79df2be0999460e3c (diff) | |
parent | 565b8d02c8c1cfaa1276970a75d336a19147589c (diff) | |
download | pleroma-57101955b681b13dfc318d3210a0b59cc377cd8b.tar.gz |
Merge branch 'cherry-pick-compact-undos' into 'maint/1.1'
Transmogrifier: Handle compact objects in undos.
See merge request pleroma/pleroma!1753
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 350b83abb..ce9ca95cf 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -753,6 +753,24 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end end + # For Undos that don't have the complete object attached, try to find it in our database. + def handle_incoming( + %{ + "type" => "Undo", + "object" => object + } = activity, + options + ) + when is_binary(object) do + with %Activity{data: data} <- Activity.get_by_ap_id(object) do + activity + |> Map.put("object", data) + |> handle_incoming(options) + else + _e -> :error + end + end + def handle_incoming(_, _), do: :error def get_obj_helper(id, options \\ []) do |