]> git.mxchange.org Git - friendica.git/commitdiff
Use the name as name
authorMichael <heluecht@pirati.ca>
Wed, 15 Apr 2020 20:45:04 +0000 (20:45 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 15 Apr 2020 20:45:04 +0000 (20:45 +0000)
src/Protocol/ActivityPub/Processor.php
src/Protocol/Diaspora.php

index a29414e941628f7c812eacf5309bd54dfc177b59..5f413f57b6aac686fb7191f47d18c4a468c516d6 100644 (file)
@@ -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]) {
index f7a63da79c2963a22d650fe150848246c1c242c8..2923125546fac572847c188c6785d8ada2eb0f07 100644 (file)
@@ -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;