* 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)
'id',
null,
$this->getUri()
- );
+ );
+
+ // title should contain fullname
$xs->element('title', null, $this->getBestName());
+ // 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(
$xs->elementEnd('activity:' . $element);
+ // XXX: Add people tags with <poco:tags> plural?
+
return $xs->getString();
}