diff options
author | Brion Vibber <brion@pobox.com> | 2010-05-27 14:57:32 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-05-27 14:57:32 -0700 |
commit | 696aeea113b88fd0f6b7c4c88eebc2f4f369d245 (patch) | |
tree | c16f91a270c2989f8e6b3799b2dfa3e39698f565 /lib/atomnoticefeed.php | |
parent | cc25ec175530a691686087db4c23a1a28ffd1b62 (diff) | |
parent | 2f2fa100715f9c09b2b91a2d1afddacf7b7f16db (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
lib/language.php
plugins/OpenID/finishaddopenid.php
Diffstat (limited to 'lib/atomnoticefeed.php')
-rw-r--r-- | lib/atomnoticefeed.php | 17 |
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)); } |