[COMPONENT][FreeNetwork] Mention and Group tags in notes are handled differently

This commit is contained in:
2022-02-21 04:52:30 +00:00
parent 7678e155d9
commit c380cbd846
3 changed files with 30 additions and 9 deletions

View File

@@ -390,11 +390,19 @@ class Note extends Model
// Mentions
foreach ($object->getNotificationTargets() as $mention) {
$attr['tag'][] = [
'type' => 'Mention',
'href' => ($href = $mention->getUri()),
'name' => FreeNetwork::mentionToName($mention->getNickname(), $href),
];
if ($mention->isGroup()) {
$attr['tag'][] = [
'type' => 'Group',
'href' => ($href = $mention->getUri()),
'name' => FreeNetwork::groupTagToName($mention->getNickname(), $href),
];
} else {
$attr['tag'][] = [
'type' => 'Mention',
'href' => ($href = $mention->getUri()),
'name' => FreeNetwork::mentionTagToName($mention->getNickname(), $href),
];
}
$attr['to'][] = $href;
}