From 22216186d9d8db26e74dc9a35232d7ea00a46817 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 27 Oct 2022 15:22:21 +0200 Subject: [PATCH] Implement getting list of followers Signed-off-by: Carl Schwan --- lib/Controller/LocalController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index c86f2545..5548f1f7 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -548,6 +548,23 @@ class LocalController extends Controller { } } + /** + * @NoAdminRequired + * @PublicPage + */ + public function accountFollowers(string $username): DataResponse { + try { + $this->initViewer(); + + $actor = $this->cacheActorService->getFromLocalAccount($username); + $following = $this->followService->getFollowers($actor); + + return $this->success($following); + } catch (Exception $e) { + return $this->fail($e); + } + } + /** * @NoAdminRequired