{Answer,Question}Validator: Keep both actor and attributedTo for now but sync them

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-06-26 00:07:43 +02:00
commit bfe2dafd39
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
6 changed files with 39 additions and 7 deletions

View file

@ -157,7 +157,12 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
end
def fix_actor(%{"attributedTo" => actor} = object) do
Map.put(object, "actor", Containment.get_actor(%{"actor" => actor}))
actor = Containment.get_actor(%{"actor" => actor})
# TODO: Remove actor field for Objects
object
|> Map.put("actor", actor)
|> Map.put("attributedTo", actor)
end
def fix_in_reply_to(object, options \\ [])