Moved permission assigning / simplified block check

This commit is contained in:
Michael 2023-01-10 05:59:25 +00:00
commit 20a2cec0b0
3 changed files with 30 additions and 30 deletions

View file

@ -180,11 +180,13 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]);
}
$post['parent'] = $toplevel_item['id'];
$post['gravity'] = Item::GRAVITY_COMMENT;
$post['thr-parent'] = $parent_item['uri'];
$post['wall'] = $toplevel_item['wall'];
} else {
$parent_item = [];
$post['parent'] = 0;
$post['gravity'] = Item::GRAVITY_PARENT;
$post['thr-parent'] = $post['uri'];
}
@ -237,14 +239,6 @@ function item_process(array $post, array $request, bool $preview, string $return
$post = DI::contentItem()->addCategories($post, $request['category'] ?? '');
if (!$preview) {
if (Photo::setPermissionFromBody($post['body'], $post['uid'], $post['contact-id'], $post['allow_cid'], $post['allow_gid'], $post['deny_cid'], $post['deny_gid'])) {
$post['object-type'] = Activity\ObjectType::IMAGE;
}
$post = DI::contentItem()->moveAttachmentsFromBodyToAttach($post);
}
// Add the attachment to the body.
if (!empty($request['has_attachment'])) {
$post['body'] .= DI::contentItem()->storeAttachmentFromRequest($request);