From 238095a719446b2887a1c0baa9abe4cf1a59fd39 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Mon, 8 Dec 2014 21:55:51 -0500 Subject: [PATCH 1/2] 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); From f71eeaee5a54a37f2356a185a74b6d88498283a0 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Mon, 8 Dec 2014 22:06:29 -0500 Subject: [PATCH 2/2] OStatus/scripts/update-profile-data.php: print updated fullnames Now that we can actually update them again. --- plugins/OStatus/scripts/update-profile-data.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/OStatus/scripts/update-profile-data.php b/plugins/OStatus/scripts/update-profile-data.php index 116061a7c3..e024ed95a7 100644 --- a/plugins/OStatus/scripts/update-profile-data.php +++ b/plugins/OStatus/scripts/update-profile-data.php @@ -26,7 +26,8 @@ $helptext = <<localProfile(); try { - foreach (array('nickname', 'bio', 'homepage', 'location') as $field) { + foreach (array('nickname', 'fullname', 'bio', 'homepage', 'location') as $field) { print " $field: {$profile->$field}\n"; } } catch (NoProfileException $e) {