[CONTROLLER][ActorController] Make ActorController extend the FeedController, so notes get filtered

This commit is contained in:
Hugo Sales 2021-12-21 12:45:15 +00:00
parent 7f65b23074
commit 027adc97b2
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -32,13 +32,13 @@ declare(strict_types = 1);
namespace App\Core\Controller; namespace App\Core\Controller;
use App\Core\Controller;
use App\Core\DB\DB; use App\Core\DB\DB;
use function App\Core\I18n\_m; use function App\Core\I18n\_m;
use App\Core\Router\Router;
use App\Util\Exception\ClientException; use App\Util\Exception\ClientException;
use App\Util\Exception\RedirectException; use App\Util\Exception\RedirectException;
abstract class ActorController extends Controller abstract class ActorController extends FeedController
{ {
/** /**
* Generic function that handles getting a representation for an actor from id * Generic function that handles getting a representation for an actor from id
@ -47,7 +47,7 @@ abstract class ActorController extends Controller
{ {
$actor = DB::findOneBy('actor', ['id' => $id]); $actor = DB::findOneBy('actor', ['id' => $id]);
if ($actor->getIsLocal()) { if ($actor->getIsLocal()) {
throw new RedirectException($actor->getUrl()); throw new RedirectException(url: $actor->getUrl(Router::ABSOLUTE_PATH));
} }
if (empty($actor)) { if (empty($actor)) {
throw new ClientException(_m('No such actor.'), 404); throw new ClientException(_m('No such actor.'), 404);