Bladeren bron

Update AP Transformers, add commentsEnabled from PeerTube

Daniel Supernault 6 jaren geleden
bovenliggende
commit
01931aea5f
2 gewijzigde bestanden met toevoegingen van 6 en 4 verwijderingen
  1. 3 2
      app/Transformer/ActivityPub/Verb/CreateNote.php
  2. 3 2
      app/Transformer/ActivityPub/Verb/Note.php

+ 3 - 2
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,
 			]
 		];
 	}

+ 3 - 2
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,
 		];
 	}
 }