From: Evan Prodromou Date: Wed, 15 Sep 2010 11:11:50 +0000 (-0400) Subject: flag to leave out author information in activity output X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0a5aa9574650d597fd34de6d37226b1bbc81dc80;p=quix0rs-gnu-social.git flag to leave out author information in activity output --- diff --git a/lib/activity.php b/lib/activity.php index 606c614320..d3c725e630 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -319,7 +319,7 @@ class Activity return null; } - function asString($namespace=false) + function asString($namespace=false, $author=true) { $xs = new XMLStringer(true); @@ -353,13 +353,15 @@ class Activity // XXX: add context - $xs->elementStart('author'); - $xs->element('uri', array(), $this->actor->id); - if ($this->actor->title) { - $xs->element('name', array(), $this->actor->title); + if ($author) { + $xs->elementStart('author'); + $xs->element('uri', array(), $this->actor->id); + 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);