[COMPONENT][Posting] Blog posts should be Articles by default

This commit is contained in:
2022-03-28 21:04:24 +01:00
parent 10f71e9fed
commit fa82306f6f
9 changed files with 41 additions and 40 deletions

View File

@@ -168,7 +168,7 @@ class Note extends Model
'type' => match ($type_note->get('type')) {
'Article' => 'article',
'Page' => 'page',
default => 'note'
default => 'note' // graceful degradation
},
'source' => $source,
];
@@ -369,11 +369,12 @@ class Note extends Model
}
$attr = [
'@context' => ActivityPub::$activity_streams_two_context,
'type' => $object->getScope() === VisibilityScope::MESSAGE ? 'ChatMessage' : (match ($object->getType()) {
'note' => 'Note',
'page' => 'Page',
default => throw new Exception('Unsupported note type.')
'@context' => ActivityPub::$activity_streams_two_context,
'type' => $object->getScope() === VisibilityScope::MESSAGE ? 'ChatMessage' : (match ($object->getType()) {
'note' => 'Note',
'article' => 'Article',
'page' => 'Page',
default => throw new Exception('Unsupported note type.')
}),
'id' => $object->getUrl(),
'url' => $object->getUrl(),