X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FFollowers.php;h=bcf4bb78291d992f0473734ae7574b88ff44ad5f;hb=76ae210527487bea129411e8ed02ac4997d0d89b;hp=9906dfc33e3b2882ee0da885a523da6ad97fd354;hpb=10114661d40b740146a66f75771aeddc17c4242e;p=friendica.git diff --git a/src/Module/Followers.php b/src/Module/Followers.php index 9906dfc33e..bcf4bb7829 100644 --- a/src/Module/Followers.php +++ b/src/Module/Followers.php @@ -1,11 +1,29 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; -use Friendica\Core\System; +use Friendica\DI; +use Friendica\Model\Contact; use Friendica\Model\User; use Friendica\Protocol\ActivityPub; @@ -14,24 +32,24 @@ use Friendica\Protocol\ActivityPub; */ class Followers extends BaseModule { - public static function rawContent() + public static function rawContent(array $parameters = []) { - $a = self::getApp(); + $a = DI::app(); // @TODO: Replace with parameter from router if (empty($a->argv[1])) { - System::httpExit(404); + throw new \Friendica\Network\HTTPException\NotFoundException(); } // @TODO: Replace with parameter from router $owner = User::getOwnerDataByNick($a->argv[1]); if (empty($owner)) { - System::httpExit(404); + throw new \Friendica\Network\HTTPException\NotFoundException(); } - $page = defaults($_REQUEST, 'page', null); + $page = $_REQUEST['page'] ?? null; - $followers = ActivityPub\Transmitter::getFollowers($owner, $page); + $followers = ActivityPub\Transmitter::getContacts($owner, [Contact::FOLLOWER, Contact::FRIEND], 'followers', $page); header('Content-Type: application/activity+json'); echo json_encode($followers);