From: Michael Date: Wed, 15 Apr 2020 20:45:04 +0000 (+0000) Subject: Use the name as name X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=472518f0b5117362bcf5c49dbaa36095820986a3;p=friendica.git Use the name as name --- diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index a29414e941..5f413f57b6 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -600,6 +600,12 @@ class Processor $fields['type'] = Term::IMPLICIT_MENTION; $fields['name'] = substr($fields['name'], 1); } + if (!empty($tag['href'])) { + $apcontact = APContact::getByURL($tag['href']); + if (!empty($apcontact['name'])) { + $fields['name'] = $apcontact['name']; + } + } } elseif ($tag['type'] == 'Hashtag') { $fields['type'] = Term::HASHTAG; if (substr($fields['name'], 0, 1) == Term::TAG_CHARACTER[Term::HASHTAG]) { diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index f7a63da79c..2923125546 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -1834,7 +1834,7 @@ class Diaspora continue; } - $fields = ['uri-id' => $uriid, 'name' => substr($person['addr'], 0, 64), 'url' => $person['url']]; + $fields = ['uri-id' => $uriid, 'name' => substr($person['name'] ?: $person['nick'], 0, 64), 'url' => $person['url']]; if ($match[1] == Term::TAG_CHARACTER[Term::MENTION]) { $fields['type'] = Term::MENTION;