object_validators: likes & announcements as [ObjectID]
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Thu, 20 Aug 2020 02:27:59 +0000 (04:27 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Thu, 10 Sep 2020 23:39:39 +0000 (01:39 +0200)
lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex
lib/pleroma/web/activity_pub/object_validators/note_validator.ex
lib/pleroma/web/activity_pub/object_validators/question_validator.ex

index a6119e62792bb1bbfb7f1469b813211944d2859d..16973e5db740e28777507aa858e777f96b5843f9 100644 (file)
@@ -49,8 +49,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AudioVideoValidator do
     field(:inReplyTo, ObjectValidators.ObjectID)
     field(:url, ObjectValidators.Uri)
 
-    field(:likes, {:array, :string}, default: [])
-    field(:announcements, {:array, :string}, default: [])
+    field(:likes, {:array, ObjectValidators.ObjectID}, default: [])
+    field(:announcements, {:array, ObjectValidators.ObjectID}, default: [])
   end
 
   def cast_and_apply(data) do
index ab4469a59ac05aee6191ab27044074e893245c19..e47cbaaea458a3093cb21a91ea86fe908c360abb 100644 (file)
@@ -43,8 +43,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator do
     field(:inReplyTo, ObjectValidators.ObjectID)
     field(:url, ObjectValidators.Uri)
 
-    field(:likes, {:array, :string}, default: [])
-    field(:announcements, {:array, :string}, default: [])
+    field(:likes, {:array, ObjectValidators.ObjectID}, default: [])
+    field(:announcements, {:array, ObjectValidators.ObjectID}, default: [])
   end
 
   def cast_and_validate(data) do
index 934d3c1ea048624c49c0831b226a8321ea98e5f7..9310485dc256fc2e1099202ee99e95a1c9d463db 100644 (file)
@@ -47,8 +47,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.QuestionValidator do
     # short identifier for PleromaFE to group statuses by context
     field(:context_id, :integer)
 
-    field(:likes, {:array, :string}, default: [])
-    field(:announcements, {:array, :string}, default: [])
+    field(:likes, {:array, ObjectValidators.ObjectID}, default: [])
+    field(:announcements, {:array, ObjectValidators.ObjectID}, default: [])
 
     field(:closed, ObjectValidators.DateTime)
     field(:voters, {:array, ObjectValidators.ObjectID}, default: [])