summaryrefslogtreecommitdiff
path: root/lib/atomnoticefeed.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-27 14:54:43 -0700
committerBrion Vibber <brion@pobox.com>2010-05-27 14:54:43 -0700
commit2f2fa100715f9c09b2b91a2d1afddacf7b7f16db (patch)
tree883a6642614484db322a3b6f17511c2ab5f46376 /lib/atomnoticefeed.php
parent87b8a89aa7b96e63586bdd3b1afb9d43355fd48b (diff)
parent2b318a3420fe3e979defc7eacfb1eb2d9321d807 (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline into testingtesting
Diffstat (limited to 'lib/atomnoticefeed.php')
-rw-r--r--lib/atomnoticefeed.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php
index 35a45118c..ef44de4b6 100644
--- a/lib/atomnoticefeed.php
+++ b/lib/atomnoticefeed.php
@@ -44,9 +44,22 @@ if (!defined('STATUSNET'))
*/
class AtomNoticeFeed extends Atom10Feed
{
- function __construct($indent = true) {
+ var $cur;
+
+ /**
+ * Constructor - adds a bunch of XML namespaces we need in our
+ * notice-specific Atom feeds, and allows setting the current
+ * authenticated user (useful for API methods).
+ *
+ * @param User $cur the current authenticated user (optional)
+ * @param boolean $indent Whether to indent XML output
+ *
+ */
+ function __construct($cur = null, $indent = true) {
parent::__construct($indent);
+ $this->cur = $cur;
+
// Feeds containing notice info use these namespaces
$this->addNamespace(
@@ -115,7 +128,7 @@ class AtomNoticeFeed extends Atom10Feed
$source = $this->showSource();
$author = $this->showAuthor();
- $cur = common_current_user();
+ $cur = empty($this->cur) ? common_current_user() : $this->cur;
$this->addEntryRaw($notice->asAtomEntry(false, $source, $author, $cur));
}