mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 12:37:46 +02:00
fix(fediverse): add is_private field to posts to flag private posts and hide them from public views
This commit is contained in:
parent
346c00e7b5
commit
8ec42c33ff
27 changed files with 207 additions and 62 deletions
|
|
@ -69,6 +69,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]);
|
||||
|
||||
|
|
@ -185,6 +190,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(),
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue