Transmogrifier: Fetch missing actors for chatmessages.
[akkoma] / lib / pleroma / web / activity_pub / object_validators / create_chat_message_validator.ex
index dfc91bf718a4cab9424343263f5249210551c127..88e90318285151be0aa5395fbb872a2fd8988b2d 100644 (file)
@@ -12,6 +12,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateChatMessageValidator do
   alias Pleroma.Web.ActivityPub.ObjectValidators.Types
 
   import Ecto.Changeset
+  import Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
 
   @primary_key false
 
@@ -42,6 +43,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateChatMessageValidator do
     cng
     |> validate_required([:id, :actor, :to, :type, :object])
     |> validate_inclusion(:type, ["Create"])
+    |> validate_actor_presence()
     |> validate_recipients_match(meta)
     |> validate_object_nonexistence()
   end