flag to leave out author information in activity output

This commit is contained in:
Evan Prodromou 2010-09-15 07:11:50 -04:00
parent fac1942dad
commit 0a5aa95746

View File

@ -319,7 +319,7 @@ class Activity
return null; return null;
} }
function asString($namespace=false) function asString($namespace=false, $author=true)
{ {
$xs = new XMLStringer(true); $xs = new XMLStringer(true);
@ -353,13 +353,15 @@ class Activity
// XXX: add context // XXX: add context
$xs->elementStart('author'); if ($author) {
$xs->element('uri', array(), $this->actor->id); $xs->elementStart('author');
if ($this->actor->title) { $xs->element('uri', array(), $this->actor->id);
$xs->element('name', array(), $this->actor->title); if ($this->actor->title) {
$xs->element('name', array(), $this->actor->title);
}
$xs->elementEnd('author');
$xs->raw($this->actor->asString('activity:actor'));
} }
$xs->elementEnd('author');
$xs->raw($this->actor->asString('activity:actor'));
$xs->element('activity:verb', null, $this->verb); $xs->element('activity:verb', null, $this->verb);