]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't output deprecated <activity:actor> element
authorEvan Prodromou <evan@status.net>
Mon, 27 Dec 2010 17:25:26 +0000 (09:25 -0800)
committerEvan Prodromou <evan@status.net>
Mon, 27 Dec 2010 17:25:26 +0000 (09:25 -0800)
lib/activity.php
lib/activityobject.php

index 3458c76b9a6d3ef61f33659abde74011d226a61d..85d3efa21aeb888aaa7a3b77188b7238a5816286 100644 (file)
@@ -377,13 +377,7 @@ class Activity
         $xs->element('updated', null, $published);
             
         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');
-            $this->actor->outputTo($xs, 'activity:actor');
+            $this->actor->outputTo($xs, 'author');
         }
 
         if ($this->verb != ActivityVerb::POST || count($this->objects) != 1) {
index 5185d7761055951ab86a3cff18a8322c38384f25..3df35f84b082dc7bf747d9f17004787053bbbacf 100644 (file)
@@ -498,14 +498,21 @@ class ActivityObject
 
         $xo->element('activity:object-type', null, $this->type);
 
-        $xo->element(self::ID, null, $this->id);
+        // <author> uses URI
+
+        if ($tag == 'author') {
+            $xo->element(self::URI, null, $this->id);
+        } else {
+            $xo->element(self::ID, null, $this->id);
+        }
 
         if (!empty($this->title)) {
-            $xo->element(
-                self::TITLE,
-                null,
-                common_xml_safe_str($this->title)
-            );
+            $name = common_xml_safe_str($this->title);
+            if ($tag == 'author') {
+                $xo->element(self::NAME, null, $name);
+            } else {
+                $xo->element(self::TITLE, null, $name);
+            }
         }
 
         if (!empty($this->summary)) {