[COMPONENT][Conversation] Remove Feed list entry

Notifications feed is enough
This commit is contained in:
Diogo Peralta Cordeiro 2021-12-23 13:16:04 +00:00
parent e743a17883
commit 17b7ef13a0
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
3 changed files with 4 additions and 38 deletions

View File

@ -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'),
];
}
}

View File

@ -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',
];
}
}

View File

@ -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;
}
}