From c465f675d9dbcf9f808bc31a1d01e753df4ddf58 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 11 Feb 2010 13:54:40 -0800 Subject: Make Atom timelines in the API use Atom10feed --- actions/apitimelineuser.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'actions/apitimelineuser.php') diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index cb8213619..d20bb0d20 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -150,6 +150,12 @@ class ApiTimelineUserAction extends ApiBareAuthAction $atom = new AtomNoticeFeed(); + $atom->setId($id); + $atom->setTitle($title); + $atom->setSubtitle($subtitle); + $atom->setLogo($logo); + $atom->setUpdated('now'); + $atom->addLink( common_local_url( 'showstream', @@ -157,25 +163,14 @@ class ApiTimelineUserAction extends ApiBareAuthAction ) ); - $atom->setId($id); - $atom->setTitle($title); - $atom->setSubtitle($subtitle); - $atom->setLogo($logo); - $atom->setUpdated('now'); - $id = $this->arg('id'); - - if ($id) { - $selfuri = common_root_url() . - 'api/statuses/user_timeline/' . - rawurlencode($id) . '.atom'; - } else { - $selfuri = common_root_url() . - 'api/statuses/user_timeline.atom'; + $aargs = array('format' => 'atom'); + if (!empty($id)) { + $aargs['id'] = $id; } $atom->addLink( - $selfuri, + $this->getSelfUri('ApiTimelineUser', $aargs), array('rel' => 'self', 'type' => 'application/atom+xml') ); -- cgit v1.2.3-54-g00ecf