X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOutbox.php;h=3a822cc6e50349f4267f492377b027aaab892bf9;hb=3f523a88b0af4e2a73b29917da33d221abef9647;hp=41e10757f1231ae90a10138fe49cc09cc4ef722b;hpb=f13b8f8ec4d0ad12e68b7bfa3fb5f5c04d6b1172;p=friendica.git diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index 41e10757f1..3a822cc6e5 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -1,13 +1,30 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; -use Friendica\Protocol\ActivityPub; -use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\User; +use Friendica\Protocol\ActivityPub; use Friendica\Util\HTTPSignature; /** @@ -15,26 +32,24 @@ use Friendica\Util\HTTPSignature; */ class Outbox 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(); } $owner = User::getOwnerDataByNick($a->argv[1]); if (empty($owner)) { - System::httpExit(404); + throw new \Friendica\Network\HTTPException\NotFoundException(); } - $page = defaults($_REQUEST, 'page', null); - - /// @todo Add Authentication to enable fetching of non public content - // $requester = HTTPSignature::getSigner('', $_SERVER); - - $outbox = ActivityPub\Transmitter::getOutbox($owner, $page); + $page = $_REQUEST['page'] ?? null; + $requester = HTTPSignature::getSigner('', $_SERVER); + $outbox = ActivityPub\Transmitter::getOutbox($owner, $page, $requester); header('Content-Type: application/activity+json'); echo json_encode($outbox); exit();