X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOutbox.php;h=3a822cc6e50349f4267f492377b027aaab892bf9;hb=3f523a88b0af4e2a73b29917da33d221abef9647;hp=14825677910919e92a50833d6866bbeb1b16f5c9;hpb=c9cce8492e5b2607b2a092474d1de4d188b7a2c9;p=friendica.git diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index 1482567791..3a822cc6e5 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -1,22 +1,40 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; -use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\User; use Friendica\Protocol\ActivityPub; +use Friendica\Util\HTTPSignature; /** * ActivityPub Outbox */ 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])) { @@ -28,13 +46,10 @@ class Outbox extends BaseModule 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();