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 --- lib/api.php | 18 ++++++++++++++++++ lib/atom10feed.php | 8 ++++++-- lib/atomnoticefeed.php | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/api.php b/lib/api.php index fd07bbbbe..8f1fe1ef7 100644 --- a/lib/api.php +++ b/lib/api.php @@ -1321,4 +1321,22 @@ class ApiAction extends Action } } + function getSelfUri($action, $aargs) + { + parse_str($_SERVER['QUERY_STRING'], $params); + $pstring = ''; + if (!empty($params)) { + unset($params['p']); + $pstring = http_build_query($params); + } + + $uri = common_local_url($action, $aargs); + + if (!empty($pstring)) { + $uri .= '?' . $pstring; + } + + return $uri; + } + } diff --git a/lib/atom10feed.php b/lib/atom10feed.php index a37f6521a..ccca76a09 100644 --- a/lib/atom10feed.php +++ b/lib/atom10feed.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') +if (!defined('STATUSNET')) { exit(1); } @@ -108,7 +108,11 @@ class Atom10Feed extends XMLStringer $this->element('id', null, $this->id); $this->element('title', null, $this->title); $this->element('subtitle', null, $this->subtitle); - $this->element('logo', null, $this->logo); + + if (!empty($this->logo)) { + $this->element('logo', null, $this->logo); + } + $this->element('updated', null, $this->updated); $this->renderLinks(); diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php index a626ab549..34ed44b2e 100644 --- a/lib/atomnoticefeed.php +++ b/lib/atomnoticefeed.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') +if (!defined('STATUSNET')) { exit(1); } @@ -85,7 +85,7 @@ class AtomNoticeFeed extends Atom10Feed } } else { while ($notices->fetch()) { - $this->addEntryFromNotice($notice); + $this->addEntryFromNotice($notices); } } } -- cgit v1.2.3-54-g00ecf