$targets = [];
- foreach (['as:to', 'as:cc', 'as:bto', 'as:bcc'] as $element) {
+ foreach (['as:to', 'as:cc', 'as:bto', 'as:bcc', 'as:audience'] as $element) {
switch ($element) {
case 'as:to':
$type = Receiver::TARGET_TO;
case 'as:bcc':
$type = Receiver::TARGET_BCC;
break;
+ case 'as:audience':
+ $type = Receiver::TARGET_AUDIENCE;
+ break;
}
$receiver_list = JsonLD::fetchElementArray($object, $element, '@id');
if (empty($receiver_list)) {
$item['contact-id'] = $owner['id'];
$item['author-id'] = $item['owner-id'] = Contact::getPublicIdByUserId($uid);
$item['title'] = $object_data['name'];
- $item['body'] = Markdown::toBBCode($object_data['content']);
+ $item['body'] = Markdown::toBBCode($object_data['content'] ?? '');
$item['app'] = $application['name'] ?? 'API';
if (!empty($object_data['target'][Receiver::TARGET_GLOBAL])) {
$apcontact = APContact::getByURL($owner['url']);
+ if (empty($apcontact)) {
+ throw new \Friendica\Network\HTTPException\NotFoundException();
+ }
+
return self::getCollection($condition, DI::baseUrl() . '/outbox/' . $owner['nickname'], $page, $max_id, $uid, $apcontact['statuses_count']);
}