[PLUGIN][ActivityPub][Model][Note] Add name property as note title

This commit is contained in:
2022-02-17 18:45:30 +00:00
parent 0a741903a1
commit 27635d8ec2
3 changed files with 7 additions and 0 deletions

View File

@@ -147,6 +147,7 @@ class Note extends Model
'created' => new DateTime($type_note->get('published') ?? 'now'),
'content' => $type_note->get('content') ?? null,
'rendered' => $type_note->has('content') ? HTML::sanitize($type_note->get('content')) : null,
'title' => $type_note->get('name') ?? null,
'content_type' => 'text/html',
'language_id' => $type_note->get('contentLang') ?? null,
'url' => $type_note->get('url') ?? $type_note->get('id'),
@@ -336,6 +337,7 @@ class Note extends Model
'id' => $object->getUrl(),
'published' => $object->getCreated()->format(DateTimeInterface::RFC3339),
'attributedTo' => $object->getActor()->getUri(Router::ABSOLUTE_URL),
'name' => $object->getTitle(),
'content' => $object->getRendered(),
'mediaType' => 'text/html',
'source' => ['content' => $object->getContent(), 'mediaType' => $object->getContentType()],