From 7e1a1506f5afd26da8dbe654f5f67f5c11d9d6e9 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 11 Mar 2010 23:28:41 +0000 Subject: [PATCH] Output self link in rss2 feeds, if available --- lib/apiaction.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index fd09f3d426..73777f4e88 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -618,13 +618,25 @@ class ApiAction extends Action $this->endDocument('xml'); } - function showRssTimeline($notice, $title, $link, $subtitle, $suplink=null, $logo=null) + function showRssTimeline($notice, $title, $link, $subtitle, $suplink = null, $logo = null, $self = null) { $this->initDocument('rss'); $this->element('title', null, $title); $this->element('link', null, $link); + + if (!is_null($self)) { + $this->element( + 'atom:link', + array( + 'type' => 'application/rss+xml', + 'href' => $self, + 'rel' => 'self' + ) + ); + } + if (!is_null($suplink)) { // For FriendFeed's SUP protocol $this->element('link', array('xmlns' => 'http://www.w3.org/2005/Atom',