From 1188d5bab2561fc50fd83afbd6ef1f45829df28b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 27 Dec 2010 09:25:26 -0800 Subject: [PATCH] Don't output deprecated element --- lib/activity.php | 8 +------- lib/activityobject.php | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/activity.php b/lib/activity.php index 3458c76b9a..85d3efa21a 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -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) { diff --git a/lib/activityobject.php b/lib/activityobject.php index 5185d77610..3df35f84b0 100644 --- a/lib/activityobject.php +++ b/lib/activityobject.php @@ -498,14 +498,21 @@ class ActivityObject $xo->element('activity:object-type', null, $this->type); - $xo->element(self::ID, null, $this->id); + // 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)) { -- 2.39.5