X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapitimelinepublic.php;h=9034614253d438b5566a1993c6b1da0182094b18;hb=a93d0dc16af0438af59d14f8413dabb80c13b707;hp=1ff0fd26172892defc5d48c047fe9da50ffb4423;hpb=5565216b42fc97d84c9602864b2095e557769717;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php index 1ff0fd2617..9034614253 100644 --- a/actions/apitimelinepublic.php +++ b/actions/apitimelinepublic.php @@ -75,10 +75,6 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $this->notices = $this->getNotices(); - if ($this->since) { - throw new ServerException("since parameter is disabled for performance; use since_id", 403); - } - return true; } @@ -111,7 +107,8 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $title = sprintf(_("%s public timeline"), $sitename); $taguribase = TagURI::base(); $id = "tag:$taguribase:PublicTimeline"; - $link = common_root_url(); + $link = common_local_url('public'); + $self = $this->getSelfUri(); $subtitle = sprintf(_("%s updates from everyone!"), $sitename); switch($this->format) { @@ -119,10 +116,20 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $this->showXmlTimeline($this->notices); break; case 'rss': - $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo); + $this->showRssTimeline( + $this->notices, + $title, + $link, + $subtitle, + null, + $sitelogo, + $self + ); break; case 'atom': + header('Content-Type: application/atom+xml; charset=utf-8'); + $atom = new AtomNoticeFeed(); $atom->setId($id); @@ -130,16 +137,8 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $atom->setSubtitle($subtitle); $atom->setLogo($sitelogo); $atom->setUpdated('now'); - $atom->addLink(common_local_url('public')); - - $atom->addLink( - $this->getSelfUri( - 'ApiTimelinePublic', array('format' => 'atom') - ), - array('rel' => 'self', 'type' => 'application/atom+xml') - ); - + $atom->setSelfLink($self); $atom->addEntryFromNotices($this->notices); $this->raw($atom->getString());