X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOutbox.php;h=3a822cc6e50349f4267f492377b027aaab892bf9;hb=3f523a88b0af4e2a73b29917da33d221abef9647;hp=f6bad56dd6c2b4f563d3e1ed2fac4f263decc7dc;hpb=a8b776c189e92034ecd252e71b0fc9e5fa364a13;p=friendica.git diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index f6bad56dd6..3a822cc6e5 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -1,36 +1,55 @@ . + * */ + 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; /** * 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])) { - 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); - - $outbox = ActivityPub::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();