X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapitimelinepublic.php;h=338cd16fa093eff36a9a0c22081146ceed0cb56b;hb=9f4bcbad8ae200d27cc2ba5244e2d878b8718c53;hp=a786aa15cca7089f243e9fc521351d62dcb49af8;hpb=36b331d469b6dcd1101783f21265f7be624bc58f;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php index a786aa15cc..338cd16fa0 100644 --- a/actions/apitimelinepublic.php +++ b/actions/apitimelinepublic.php @@ -38,8 +38,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiprivateauth.php'; - /** * Returns the most recent notices (default 20) posted by everybody * @@ -235,7 +233,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $this->showJsonTimeline($this->notices); break; case 'as': - header('Content-Type: application/json; charset=utf-8'); + header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE); $doc = new ActivityStreamJSONDocument($this->auth_user); $doc->setTitle($title); $doc->addLink($link, 'alternate', 'text/html'); @@ -258,14 +256,18 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction { $notices = array(); - $notice = Notice::publicStream( - ($this->page - 1) * $this->count, $this->count, $this->since_id, - $this->max_id - ); + $profile = ($this->auth_user) ? $this->auth_user->getProfile() : null; - while ($notice->fetch()) { - $notices[] = clone($notice); - } + $stream = new PublicNoticeStream($profile); + + $notice = $stream->getNotices(($this->page - 1) * $this->count, + $this->count, + $this->since_id, + $this->max_id); + + $notices = $notice->fetchAll(); + + NoticeList::prefill($notices); return $notices; }