diff --git a/components/Conversation/Controller/Conversation.php b/components/Conversation/Controller/Conversation.php index 6fd5313395..974a47fae4 100644 --- a/components/Conversation/Controller/Conversation.php +++ b/components/Conversation/Controller/Conversation.php @@ -26,8 +26,9 @@ declare(strict_types = 1); namespace Component\Conversation\Controller; -use App\Core\Controller\FeedController; use App\Core\DB\DB; +use function App\Core\I18n\_m; +use Component\Feed\Util\FeedController; use Symfony\Component\HttpFoundation\Request; class Conversation extends FeedController @@ -50,7 +51,7 @@ class Conversation extends FeedController '_template' => 'feed/feed.html.twig', 'notes' => $notes, 'should_format' => false, - 'page_title' => 'Conversation', + 'page_title' => _m('Conversation'), ]; } } diff --git a/components/Conversation/Controller/Reply.php b/components/Conversation/Controller/Reply.php index 7489f3ed19..7d322e5759 100644 --- a/components/Conversation/Controller/Reply.php +++ b/components/Conversation/Controller/Reply.php @@ -26,14 +26,13 @@ declare(strict_types = 1); namespace Component\Conversation\Controller; -use App\Core\Controller\FeedController; -use App\Core\DB\DB; use App\Entity\Note; use App\Util\Common; use App\Util\Exception\ClientException; use App\Util\Exception\NoLoggedInUser; use App\Util\Exception\NoSuchNoteException; use App\Util\Exception\ServerException; +use Component\Feed\Util\FeedController; use Symfony\Component\HttpFoundation\Request; class Reply extends FeedController @@ -62,25 +61,4 @@ class Reply extends FeedController 'note' => $note, ]; } - - /** - * Render actor replies page - * - * @throws NoLoggedInUser - * - * @return array - */ - public function showReplies(Request $request) - { - $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], ); - return [ - '_template' => 'feed/feed.html.twig', - 'notes' => $notes, - 'should_format' => false, - 'page_title' => 'Replies feed', - ]; - } } diff --git a/components/Conversation/Conversation.php b/components/Conversation/Conversation.php index 9705c8af8f..2b58d20a7e 100644 --- a/components/Conversation/Conversation.php +++ b/components/Conversation/Conversation.php @@ -176,21 +176,8 @@ class Conversation extends Component public function onAddRoute(RouteLoader $r): bool { $r->connect('reply_add', '/object/note/new?to={actor_id<\d+>}&reply_to={note_id<\d+>}', [ReplyController::class, 'addReply']); - $r->connect('replies', '/@{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [ReplyController::class, 'showReplies']); $r->connect('conversation', '/conversation/{conversation_id<\d+>}', [Controller\Conversation::class, 'showConversation']); return Event::next; } - - public function onCreateDefaultFeeds(int $actor_id, LocalUser $user, int &$ordering): bool - { - DB::persist(Feed::create([ - 'actor_id' => $actor_id, - 'url' => Router::url($route = 'replies', ['nickname' => $user->getNickname()]), - 'route' => $route, - 'title' => _m('Replies'), - 'ordering' => $ordering++, - ])); - return Event::next; - } }