[PLUGIN][ActivityPub] Provide ActivityStreams 2.0 responses for every Collection

Implemented ActivityPub Outbox
This commit is contained in:
2022-01-11 20:28:15 +00:00
parent f3a7e8f04d
commit 59b8bdf99b
9 changed files with 214 additions and 15 deletions

View File

@@ -53,7 +53,7 @@ abstract class Parser
*
* @return Criteria[]
*/
public static function parse(string $input, ?string $language = null, ?Actor $actor = null, int $level = 0): array
public static function parse(string $input, ?string $locale = null, ?Actor $actor = null, int $level = 0): array
{
if ($level === 0) {
$input = trim(preg_replace(['/\s+/', '/\s+AND\s+/', '/\s+OR\s+/'], [' ', '&', '|'], $input), ' |&');
@@ -78,7 +78,7 @@ abstract class Parser
$term = mb_substr($input, $left, $end ? null : $right - $left);
$note_res = null;
$actor_res = null;
Event::handle('CollectionQueryCreateExpression', [$eb, $term, $language, $actor, &$note_res, &$actor_res]);
Event::handle('CollectionQueryCreateExpression', [$eb, $term, $locale, $actor, &$note_res, &$actor_res]);
if (\is_null($note_res) && \is_null($actor_res)) { // @phpstan-ignore-line
throw new ServerException("No one claimed responsibility for a match term: {$term}");
}