alias Pleroma.Web.ActivityPub.ObjectValidators.Types
import Ecto.Changeset
+ import Pleroma.Web.ActivityPub.Transmogrifier, only: [fix_emoji: 1]
@primary_key false
@derive Jason.Encoder
field(:id, Types.ObjectID, primary_key: true)
field(:to, Types.Recipients, default: [])
field(:type, :string)
- field(:content, :string)
+ field(:content, Types.SafeText)
field(:actor, Types.ObjectID)
field(:published, Types.DateTime)
field(:emoji, :map, default: %{})
def fix(data) do
data
+ |> fix_emoji()
|> Map.put_new("actor", data["attributedTo"])
end