From 238095a719446b2887a1c0baa9abe4cf1a59fd39 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Mon, 8 Dec 2014 21:55:51 -0500 Subject: [PATCH] Parse remote users' fullnames from PoCo::displayName elements Try this first; use activity:subject->atom:title only as a fallback. The code that output activity:subject was removed 2013-10-08, and it it was deprecated for years before that.... --- lib/activityobject.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/activityobject.php b/lib/activityobject.php index 7fe5c4850c..9a6218de3a 100644 --- a/lib/activityobject.php +++ b/lib/activityobject.php @@ -195,15 +195,22 @@ class ActivityObject $this->type = self::PERSON; // XXX: is this fair? } - // start with - $title = ActivityUtils::childHtmlContent($element, self::TITLE); + // Start with - if (!empty($title)) { - $this->title = common_strip_html($title); + $this->title = ActivityUtils::childContent($element, PoCo::DISPLAYNAME, PoCo::NS); + + // try falling back to + + if (empty($this->title)) { + $title = ActivityUtils::childHtmlContent($element, self::TITLE); + + if (!empty($title)) { + $this->title = common_strip_html($title); + } } - // fall back to + // fall back to as a last resort if (empty($this->title)) { $this->title = $this->_childContent($element, self::NAME); -- 2.39.5