From: Hypolite Petovan Date: Mon, 9 Nov 2020 04:32:02 +0000 (-0500) Subject: [AP] Use contact.alias if it exists instead of contact.url for mention links X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7debe1e999ca5a620f6e3e7c89f93ab84c50ccc6;p=friendica.git [AP] Use contact.alias if it exists instead of contact.url for mention links - Make mentions links handled by Mastodon for logged in users --- diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index bc4b31fb12..750c7f625d 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -1253,12 +1253,12 @@ class Transmitter return ''; } - $data = Contact::getByURL($match[1], false, ['url', 'nick']); + $data = Contact::getByURL($match[1], false, ['url', 'alias', 'nick']); if (empty($data['nick'])) { return $match[0]; } - return '[url=' . $data['url'] . ']@' . $data['nick'] . '[/url]'; + return '[url=' . ($data['alias'] ?: $data['url']) . ']@' . $data['nick'] . '[/url]'; } /**