[PLUGIN][ActivityPub][Model][Note] toJson: Respect source attribute and @language from context

This commit is contained in:
Diogo Peralta Cordeiro 2022-03-17 23:01:59 +00:00
parent a08b661779
commit 06c67b31c2
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 3 additions and 0 deletions

View File

@ -466,6 +466,9 @@ class Note extends Model
];
}
// Language
$attr['@context'][] = ['@language' => $object->getLanguageLocale() ?? 'und'];
$type = self::jsonToType($attr);
Event::handle('ActivityPubAddActivityStreamsTwoData', [$type->get('type'), &$type]);
return $type->toJson($options);