projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix multi-after-transaction
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
object_validators
/
create_chat_message_validator.ex
diff --git
a/lib/pleroma/web/activity_pub/object_validators/create_chat_message_validator.ex
b/lib/pleroma/web/activity_pub/object_validators/create_chat_message_validator.ex
index 8384c16a7ee5002a2e9ed3599e7d9627382f2747..6551f64cac69d66d5a5a46f9558d3004f3c05532 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validators/create_chat_message_validator.ex
+++ b/
lib/pleroma/web/activity_pub/object_validators/create_chat_message_validator.ex
@@
-17,11
+17,16
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateChatMessageValidator do
@primary_key false
embedded_schema do
@primary_key false
embedded_schema do
+ quote do
+ unquote do
+ import Elixir.Pleroma.Web.ActivityPub.ObjectValidators.CommonFields
+ activity_fields()
+ end
+ end
+
field(:id, ObjectValidators.ObjectID, primary_key: true)
field(:id, ObjectValidators.ObjectID, primary_key: true)
- field(:actor, ObjectValidators.ObjectID)
field(:type, :string)
field(:to, ObjectValidators.Recipients, default: [])
field(:type, :string)
field(:to, ObjectValidators.Recipients, default: [])
- field(:object, ObjectValidators.ObjectID)
end
def cast_and_apply(data) do
end
def cast_and_apply(data) do
@@
-39,7
+44,7
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateChatMessageValidator do
|> validate_data(meta)
end
|> validate_data(meta)
end
- def
validate_data(cng, meta \\ []
) do
+ def
p validate_data(cng, meta
) do
cng
|> validate_required([:id, :actor, :to, :type, :object])
|> validate_inclusion(:type, ["Create"])
cng
|> validate_required([:id, :actor, :to, :type, :object])
|> validate_inclusion(:type, ["Create"])