summaryrefslogtreecommitdiff
path: root/lib/activity.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-15 07:11:50 -0400
committerEvan Prodromou <evan@status.net>2010-09-15 07:11:50 -0400
commit0a5aa9574650d597fd34de6d37226b1bbc81dc80 (patch)
tree44ce1a11bc614df242a8060ffc0b03a77f306ba6 /lib/activity.php
parentfac1942dad983eb9f7f455c252c472873f9b2e60 (diff)
flag to leave out author information in activity output
Diffstat (limited to 'lib/activity.php')
-rw-r--r--lib/activity.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/activity.php b/lib/activity.php
index 606c61432..d3c725e63 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);