From 7debe1e999ca5a620f6e3e7c89f93ab84c50ccc6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 8 Nov 2020 23:32:02 -0500 Subject: [PATCH] [AP] Use contact.alias if it exists instead of contact.url for mention links - Make mentions links handled by Mastodon for logged in users --- src/Protocol/ActivityPub/Transmitter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index bc4b31fb1..750c7f625 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]'; } /**