diff --git a/plugins/Reply/Controller/Reply.php b/plugins/Reply/Controller/Reply.php index ce5e50d5b1..1e12ba4721 100644 --- a/plugins/Reply/Controller/Reply.php +++ b/plugins/Reply/Controller/Reply.php @@ -38,6 +38,7 @@ use App\Util\Common; use App\Util\Exception\ClientException; use App\Util\Exception\InvalidFormException; use App\Util\Exception\NoSuchNoteException; +use App\Util\Exception\NotImplementedException; use App\Util\Exception\RedirectException; use App\Util\Form\FormFields; use Component\Posting\Posting; @@ -138,4 +139,23 @@ class Reply extends Controller 'add_reply' => $form->createView(), ]; } + + public function replies(Request $request) + { + // TODO replies + throw new NotImplementedException; + $actor_id = Common::ensureLoggedIn()->getId(); + $notes = DB::dql('select n from App\Entity\Note n ' + . 'where n.reply_to is not null and n.actor_id = :id ' + . 'order by n.created DESC', ['id' => $actor_id], ); + + $notes_out = null; + Event::handle('FormatNoteList', [$notes, &$notes_out]); + + return [ + '_template' => 'feeds/feed.html.twig', + 'notes' => $notes_out, + 'page_title' => 'Replies feed', + ]; + } } diff --git a/plugins/Reply/Reply.php b/plugins/Reply/Reply.php index 4f661d72d0..e5c6399ff9 100644 --- a/plugins/Reply/Reply.php +++ b/plugins/Reply/Reply.php @@ -134,6 +134,10 @@ class Reply extends NoteHandlerPlugin public function onAddRoute($r) { $r->connect('reply_add', '/object/note/{id<\d+>}/reply', [ReplyController::class, 'replyAddNote']); + $r->connect('replies', '/@{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [ReplyController::class, 'replies']); + + return Event::next; + } return Event::next; }