diff options
author | Zach Copley <zach@status.net> | 2010-03-11 23:43:03 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-11 23:43:03 +0000 |
commit | 212b20e876fac3b989cd79b1b896b88f50995a37 (patch) | |
tree | 9911fac8e7595e83b38ed791e4e23b818ab4adfe /actions/apitimelinegroup.php | |
parent | 7e1a1506f5afd26da8dbe654f5f67f5c11d9d6e9 (diff) |
Add self link to user and group rss2 feeds
Diffstat (limited to 'actions/apitimelinegroup.php')
-rw-r--r-- | actions/apitimelinegroup.php | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index 8f971392b..c4f8cbc65 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -107,6 +107,14 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction // We'll pull common formatting out of this for other formats $atom = new AtomGroupNoticeFeed($this->group); + // Calculate self link + $id = $this->arg('id'); + $aargs = array('format' => $this->format); + if (!empty($id)) { + $aargs['id'] = $id; + } + $self = $this->getSelfUri('ApiTimelineGroup', $aargs); + switch($this->format) { case 'xml': $this->showXmlTimeline($this->notices); @@ -118,7 +126,8 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction $this->group->homeUrl(), $atom->subtitle, null, - $atom->logo + $atom->logo, + $self ); break; case 'atom': @@ -126,24 +135,12 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction header('Content-Type: application/atom+xml; charset=utf-8'); try { - $atom->addAuthorRaw($this->group->asAtomAuthor()); $atom->setActivitySubject($this->group->asActivitySubject()); - - $id = $this->arg('id'); - $aargs = array('format' => 'atom'); - if (!empty($id)) { - $aargs['id'] = $id; - } - $self = $this->getSelfUri('ApiTimelineGroup', $aargs); - $atom->setId($self); $atom->setSelfLink($self); - $atom->addEntryFromNotices($this->notices); - $this->raw($atom->getString()); - } catch (Atom10FeedException $e) { $this->serverError( 'Could not generate feed for group - ' . $e->getMessage() |