diff options
author | Sarven Capadisli <csarven@status.net> | 2010-02-22 17:08:54 +0100 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-02-22 17:08:54 +0100 |
commit | c88507fe110ff4e14c9d605de385dc0218968e81 (patch) | |
tree | 9a28baddb98db908ae74af95342b4caf8ca7de31 /classes/Profile.php | |
parent | 3569493ba7e77a1a9f19bdbbf3f2d5f262ea8484 (diff) | |
parent | 13ad48fab3b64e9c8376761b55caa1e19a49934b (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'classes/Profile.php')
-rw-r--r-- | classes/Profile.php | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 5ff746e30..7fb2b87bc 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -792,9 +792,11 @@ class Profile extends Memcached_DataObject * Returns an XML string fragment with profile information as an * Activity Streams noun object with the given element type. * - * Assumes that 'activity' namespace has been previously defined. + * Assumes that 'activity', 'georss', and 'poco' namespace has been + * previously defined. * * @param string $element one of 'actor', 'subject', 'object', 'target' + * * @return string */ function asActivityNoun($element) @@ -811,9 +813,52 @@ class Profile extends Memcached_DataObject 'id', null, $this->getUri() - ); + ); + + // title should contain fullname $xs->element('title', null, $this->getBestName()); + $xs->element('link', array('rel' => 'alternate', + 'type' => 'text/html'), + $this->profileurl); + + $xs->element('poco:preferredUsername', null, $this->nickname); + + // Portable Contacts stuff + + if (isset($this->bio)) { + + // XXX: Possible to use OpenSocial's aboutMe? + + $xs->element('poco:note', null, $this->bio); + } + + if (isset($this->homepage)) { + + $xs->elementStart('poco:urls'); + $xs->element('poco:value', null, $this->homepage); + $xs->element('poco:type', null, 'homepage'); + $xs->element('poco:primary', null, 'true'); + $xs->elementEnd('poco:urls'); + } + + if (isset($this->location)) { + $xs->elementStart('poco:address'); + $xs->element('poco:formatted', null, $this->location); + $xs->elementEnd('poco:address'); + } + + if (isset($this->lat) && isset($this->lon)) { + $this->element( + 'georss:point', + null, + (float)$this->lat . ' ' . (float)$this->lon + ); + } + + // XXX: Should we send all avatar sizes we have? I think + // cliqset does -Z + $avatar = $this->getAvatar(AVATAR_PROFILE_SIZE); $xs->element( @@ -829,6 +874,8 @@ class Profile extends Memcached_DataObject $xs->elementEnd('activity:' . $element); + // XXX: Add people tags with <poco:tags> plural? + return $xs->getString(); } |