summaryrefslogtreecommitdiff
path: root/actions/apitimelineuser.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-15 21:14:01 +0000
committerZach Copley <zach@status.net>2010-02-15 21:14:01 +0000
commit82033b3773ac0fc95236716388a02bb6d2da2cab (patch)
treef58d7a9a220035e63fa13bc36f0922c5f1c8d729 /actions/apitimelineuser.php
parentfe2ebec732ecae97b0616cdf627cbaeaf53dab48 (diff)
parent14a7353fd5583066b154836cccf035e87310ee97 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'actions/apitimelineuser.php')
-rw-r--r--actions/apitimelineuser.php49
1 files changed, 39 insertions, 10 deletions
diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php
index 830b16941..d20bb0d20 100644
--- a/actions/apitimelineuser.php
+++ b/actions/apitimelineuser.php
@@ -145,18 +145,47 @@ class ApiTimelineUserAction extends ApiBareAuthAction
);
break;
case 'atom':
- if (isset($apidata['api_arg'])) {
- $selfuri = common_root_url() .
- 'api/statuses/user_timeline/' .
- $apidata['api_arg'] . '.atom';
- } else {
- $selfuri = common_root_url() .
- 'api/statuses/user_timeline.atom';
+
+ header('Content-Type: application/atom+xml; charset=utf-8');
+
+ $atom = new AtomNoticeFeed();
+
+ $atom->setId($id);
+ $atom->setTitle($title);
+ $atom->setSubtitle($subtitle);
+ $atom->setLogo($logo);
+ $atom->setUpdated('now');
+
+ $atom->addLink(
+ common_local_url(
+ 'showstream',
+ array('nickname' => $this->user->nickname)
+ )
+ );
+
+ $id = $this->arg('id');
+ $aargs = array('format' => 'atom');
+ if (!empty($id)) {
+ $aargs['id'] = $id;
}
- $this->showAtomTimeline(
- $this->notices, $title, $id, $link,
- $subtitle, $suplink, $selfuri, $logo
+
+ $atom->addLink(
+ $this->getSelfUri('ApiTimelineUser', $aargs),
+ array('rel' => 'self', 'type' => 'application/atom+xml')
+ );
+
+ $atom->addLink(
+ $suplink,
+ array(
+ 'rel' => 'http://api.friendfeed.com/2008/03#sup',
+ 'type' => 'application/json'
+ )
);
+
+ $atom->addEntryFromNotices($this->notices);
+
+ $this->raw($atom->getString());
+
break;
case 'json':
$this->showJsonTimeline($this->notices);