summaryrefslogtreecommitdiff
path: root/actions/apitimelinepublic.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-15 21:14:32 +0000
committerZach Copley <zach@status.net>2010-02-15 21:14:32 +0000
commit5db40c440dcfa3f9d19f047c003bbcfaeb69dbc9 (patch)
treea6b86448b61ddeecfc0abdc5a13f1eca5723a3e1 /actions/apitimelinepublic.php
parent5cc1f8b001057e9c4301b173391a7f0a5415f153 (diff)
parentf5c69dfbf946438fbe1f472de3adb4514db8d090 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'actions/apitimelinepublic.php')
-rw-r--r--actions/apitimelinepublic.php31
1 files changed, 26 insertions, 5 deletions
diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php
index 3f4a46c0f..c1fa72a3e 100644
--- a/actions/apitimelinepublic.php
+++ b/actions/apitimelinepublic.php
@@ -75,6 +75,10 @@ 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;
}
@@ -118,11 +122,28 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo);
break;
case 'atom':
- $selfuri = common_root_url() . 'api/statuses/public_timeline.atom';
- $this->showAtomTimeline(
- $this->notices, $title, $id, $link,
- $subtitle, null, $selfuri, $sitelogo
+
+ $atom = new AtomNoticeFeed();
+
+ $atom->setId($id);
+ $atom->setTitle($title);
+ $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->addEntryFromNotices($this->notices);
+
+ $this->raw($atom->getString());
+
break;
case 'json':
$this->showJsonTimeline($this->notices);
@@ -145,7 +166,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$notice = Notice::publicStream(
($this->page - 1) * $this->count, $this->count, $this->since_id,
- $this->max_id, $this->since
+ $this->max_id
);
while ($notice->fetch()) {