]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
flag to leave out author information in activity output
authorEvan Prodromou <evan@status.net>
Wed, 15 Sep 2010 11:11:50 +0000 (07:11 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 15 Sep 2010 11:11:50 +0000 (07:11 -0400)
lib/activity.php

index 606c614320a56a496e94c0c9d7d6aad6a7171e61..d3c725e630bd9e7d0cd307b6f231211589f300b0 100644 (file)
@@ -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);