summaryrefslogtreecommitdiff
path: root/classes/Profile.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-06-22 16:28:06 -0700
committerZach Copley <zach@status.net>2010-06-22 16:28:06 -0700
commit1eec7f779fc85b530907ea31deceadb2a30d7614 (patch)
tree16750d5fa88a8dcc160a15a9fc92375563a488cd /classes/Profile.php
parent1852eae36f9ed9a57d37f2048dfbf2257c7eccb4 (diff)
- Add profile_info tag to Atom author
- Normalize xmlns:statusnet links in the API
Diffstat (limited to 'classes/Profile.php')
-rw-r--r--classes/Profile.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 54f557ea7..a303469e9 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -849,15 +849,23 @@ class Profile extends Memcached_DataObject
*
* Assumes that Atom has been previously set up as the base namespace.
*
+ * @param Profile $cur the current authenticated user
+ *
* @return string
*/
- function asAtomAuthor()
+ function asAtomAuthor($cur = null)
{
$xs = new XMLStringer(true);
$xs->elementStart('author');
$xs->element('name', null, $this->nickname);
$xs->element('uri', null, $this->getUri());
+ if ($cur != null) {
+ $attrs = Array();
+ $attrs['following'] = $cur->isSubscribed($this) ? 'true' : 'false';
+ $attrs['blocking'] = $cur->hasBlocked($this) ? 'true' : 'false';
+ $xs->element('statusnet:profile_info', $attrs, null);
+ }
$xs->elementEnd('author');
return $xs->getString();