$fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
$item = Post::selectFirst($fields, ['id' => $id, 'private' => [Item::PUBLIC, Item::UNLISTED]]);
- if (!empty($item['body'])) {
+ if (DBA::isResult($item)) {
if (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::TWITTER])) {
if (!Item::performActivity($id, 'announce', local_user())) {
throw new InternalServerErrorException();
$item_id = item_post($a);
}
} else {
- throw new ForbiddenException(!DBA::isResult($item) ? 'not found' : 'empty body');
+ throw new ForbiddenException();
}
// output the post that we just posted.