summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-11 13:54:40 -0800
committerZach Copley <zach@status.net>2010-02-11 13:56:05 -0800
commitc465f675d9dbcf9f808bc31a1d01e753df4ddf58 (patch)
treecccfd152bf1d52f27cd63d00c0337c1273991a11 /lib
parentc8d5c8442fe6ce54f7f65d1d0eb4203b06c09583 (diff)
Make Atom timelines in the API use Atom10feed
Diffstat (limited to 'lib')
-rw-r--r--lib/api.php18
-rw-r--r--lib/atom10feed.php8
-rw-r--r--lib/atomnoticefeed.php4
3 files changed, 26 insertions, 4 deletions
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);
}
}
}