{
$orig = clone($profile);
- $profile->nickname = self::getActivityObjectNickname($object, $hints);
+ // Existing nickname is better than nothing.
+
+ if (!array_key_exists('nickname', $hints)) {
+ $hints['nickname'] = $profile->nickname;
+ }
+
+ $nickname = self::getActivityObjectNickname($object, $hints);
+
+ if (!empty($nickname)) {
+ $profile->nickname = $nickname;
+ }
if (!empty($object->title)) {
$profile->fullname = $object->title;
$profile->profileurl = $object->id;
}
- $profile->bio = self::getActivityObjectBio($object, $hints);
- $profile->location = self::getActivityObjectLocation($object, $hints);
- $profile->homepage = self::getActivityObjectHomepage($object, $hints);
+ $bio = self::getActivityObjectBio($object, $hints);
+
+ if (!empty($bio)) {
+ $profile->bio = $bio;
+ }
+
+ $location = self::getActivityObjectLocation($object, $hints);
+
+ if (!empty($location)) {
+ $profile->location = $location;
+ }
+
+ $homepage = self::getActivityObjectHomepage($object, $hints);
+
+ if (!empty($homepage)) {
+ $profile->homepage = $homepage;
+ }
if (!empty($object->geopoint)) {
$location = ActivityContext::locationFromPoint($object->geopoint);