fix(fediverse): add is_private field to posts to flag private posts and hide them from public views

This commit is contained in:
Yassine Doghri 2025-08-22 09:56:45 +00:00
commit d5ef2ab86f
25 changed files with 4276 additions and 4233 deletions

View file

@ -66,6 +66,11 @@ class PostController extends FediversePostController
$this->post = $post;
// show 404 if post is private
if ($this->post->is_private && ! can_user_interact()) {
throw PageNotFoundException::forPageNotFound();
}
unset($params[0]);
unset($params[1]);
@ -183,6 +188,7 @@ class PostController extends FediversePostController
'actor_id' => interact_as_actor_id(),
'in_reply_to_id' => $this->post->id,
'message' => $validData['message'],
'is_private' => $this->post->is_private,
'published_at' => Time::now(),
'created_by' => user_id(),
]);