diff options
author | Zach Copley <zach@status.net> | 2010-03-12 03:15:51 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-12 03:15:51 +0000 |
commit | 849d0b5dcddccd935270f079fc1279d726eb2853 (patch) | |
tree | 45684d8e634b2fea4e2ed717557fd6ea7008906b /actions | |
parent | 0444cc7bfb7cf3b7353385180e0ec6e19385b2eb (diff) |
Output Atom self link in home timeline
Diffstat (limited to 'actions')
-rw-r--r-- | actions/apitimelinehome.php | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/actions/apitimelinehome.php b/actions/apitimelinehome.php index abd387786..1618c9923 100644 --- a/actions/apitimelinehome.php +++ b/actions/apitimelinehome.php @@ -72,7 +72,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction function prepare($args) { parent::prepare($args); - common_debug("api home_timeline"); + $this->user = $this->getTargetUser($this->arg('id')); if (empty($this->user)) { @@ -121,8 +121,15 @@ class ApiTimelineHomeAction extends ApiBareAuthAction $this->user->nickname, $sitename ); - $logo = (!empty($avatar)) - ? $avatar->displayUrl() + $link = common_local_url( + 'all', + array('nickname' => $this->user->nickname) + ); + + $self = $this->getSelfUri(); + + $logo = (!empty($avatar)) + ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE); switch($this->format) { @@ -130,17 +137,14 @@ class ApiTimelineHomeAction extends ApiBareAuthAction $this->showXmlTimeline($this->notices); break; case 'rss': - $link = common_local_url( - 'all', - array('nickname' => $this->user->nickname) - ); $this->showRssTimeline( $this->notices, $title, $link, $subtitle, null, - $logo + $logo, + $self ); break; case 'atom': @@ -155,23 +159,8 @@ class ApiTimelineHomeAction extends ApiBareAuthAction $atom->setLogo($logo); $atom->setUpdated('now'); - $atom->addLink( - common_local_url( - 'all', - array('nickname' => $this->user->nickname) - ) - ); - - $id = $this->arg('id'); - $aargs = array('format' => 'atom'); - if (!empty($id)) { - $aargs['id'] = $id; - } - - $atom->addLink( - $this->getSelfUri('ApiTimelineHome', $aargs), - array('rel' => 'self', 'type' => 'application/atom+xml') - ); + $atom->addLink($link); + $atom->setSelfLink($self); $atom->addEntryFromNotices($this->notices); $this->raw($atom->getString()); |