From 01931aea5fd86e41d8463f8c72bf1121bd43beec Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 4 Apr 2019 11:53:11 -0600 Subject: [PATCH] Update AP Transformers, add commentsEnabled from PeerTube --- app/Transformer/ActivityPub/Verb/CreateNote.php | 5 +++-- app/Transformer/ActivityPub/Verb/Note.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Transformer/ActivityPub/Verb/CreateNote.php b/app/Transformer/ActivityPub/Verb/CreateNote.php index d5e490134..c30a2cb8c 100644 --- a/app/Transformer/ActivityPub/Verb/CreateNote.php +++ b/app/Transformer/ActivityPub/Verb/CreateNote.php @@ -31,9 +31,10 @@ class CreateNote extends Fractal\TransformerAbstract 'https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1', [ + 'sc' => 'http://schema.org#', 'Hashtag' => 'as:Hashtag', 'sensitive' => 'as:sensitive', - 'commentsDisabled' => 'as:commentsDisabled', + 'commentsEnabled' => 'sc:Boolean', ] ], 'id' => $status->permalink(), @@ -63,7 +64,7 @@ class CreateNote extends Fractal\TransformerAbstract ]; })->toArray(), 'tag' => $tags, - 'commentsDisabled' => (bool) $status->comments_disabled, + 'commentsEnabled' => (bool) !$status->comments_disabled, ] ]; } diff --git a/app/Transformer/ActivityPub/Verb/Note.php b/app/Transformer/ActivityPub/Verb/Note.php index ac302b74d..3dafe32aa 100644 --- a/app/Transformer/ActivityPub/Verb/Note.php +++ b/app/Transformer/ActivityPub/Verb/Note.php @@ -31,9 +31,10 @@ class Note extends Fractal\TransformerAbstract 'https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1', [ + 'sc' => 'http://schema.org#', 'Hashtag' => 'as:Hashtag', 'sensitive' => 'as:sensitive', - 'commentsDisabled' => 'as:commentsDisabled', + 'commentsEnabled' => 'sc:Boolean', ] ], 'id' => $status->url(), @@ -56,7 +57,7 @@ class Note extends Fractal\TransformerAbstract ]; })->toArray(), 'tag' => $tags, - 'commentsDisabled' => (bool) $status->comments_disabled, + 'commentsEnabled' => (bool) !$status->comments_disabled, ]; } }