[TEMPLATES][Cards][Profile] Provide both actor uri and url, as well as full mention guidance

This commit is contained in:
2021-12-27 04:13:09 +00:00
parent eb761609aa
commit 80afc0fa6c
9 changed files with 69 additions and 50 deletions

View File

@@ -55,13 +55,13 @@ use App\Util\TemporaryFile;
use Component\Attachment\Entity\ActorToAttachment;
use Component\Attachment\Entity\AttachmentToNote;
use Component\Conversation\Conversation;
use Component\FreeNetwork\FreeNetwork;
use Component\Language\Entity\Language;
use Component\Tag\Tag;
use DateTime;
use DateTimeInterface;
use Exception;
use InvalidArgumentException;
use const PHP_URL_HOST;
use Plugin\ActivityPub\ActivityPub;
use Plugin\ActivityPub\Entity\ActivitypubObject;
use Plugin\ActivityPub\Util\Model;
@@ -356,7 +356,7 @@ class Note extends Model
$attr['tag'][] = [
'type' => 'Mention',
'href' => ($href = $mention->getUri()),
'name' => '@' . $mention->getNickname() . '@' . parse_url($href, PHP_URL_HOST),
'name' => FreeNetwork::mentionToName($mention->getNickname(), $href),
];
$attr['to'][] = $href;
}