diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 3e547fcaf..be3cec470 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1198,20 +1198,16 @@ class Contact $pm_url = 'message/new/' . $contact['id']; } - if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { - $mention_label = DI::l10n()->t('Post to group'); - $mention_url = 'compose/0?body=!' . $contact['addr']; - } else { - $mention_label = DI::l10n()->t('Mention'); - $mention_url = 'compose/0?body=@' . $contact['addr']; - } - $contact_url = 'contact/' . $contact['id']; if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { + $mention_label = DI::l10n()->t('Post to group'); + $mention_url = 'compose/0?body=!' . $contact['addr']; $network_label = DI::l10n()->t('View group'); $network_url = 'network/group/' . $contact['id']; } else { + $mention_label = DI::l10n()->t('Mention'); + $mention_url = 'compose/0?body=@' . $contact['addr']; $network_label = DI::l10n()->t('Network Posts'); $network_url = 'contact/' . $contact['id'] . '/conversations'; } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 9c7aab54a..0aa44c673 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -453,6 +453,18 @@ class Profile Logger::warning('Missing hidewall key in profile array', ['profile' => $profile, 'callstack' => System::callstack(10)]); } + if ($profile['account-type'] == Contact::TYPE_COMMUNITY) { + $mention_label = DI::l10n()->t('Post to group'); + $mention_url = 'compose/0?body=!' . $profile['addr']; + $network_label = DI::l10n()->t('View group'); + $network_url = 'network/group/' . $profile['id']; + } else { + $mention_label = DI::l10n()->t('Mention'); + $mention_url = 'compose/0?body=@' . $profile['addr']; + $network_label = DI::l10n()->t('Network Posts'); + $network_url = 'contact/' . $profile['id'] . '/conversations'; + } + $tpl = Renderer::getMarkupTemplate('profile/vcard.tpl'); $o .= Renderer::replaceMacros($tpl, [ '$profile' => $p, @@ -476,6 +488,10 @@ class Profile '$updated' => $updated, '$diaspora' => $diaspora, '$contact_block' => $contact_block, + '$mention_label' => $mention_label, + '$mention_url' => $mention_url, + '$network_label' => $network_label, + '$network_url' => $network_url, ]); $arr = ['profile' => &$profile, 'entry' => &$o]; diff --git a/view/theme/frio/templates/profile/vcard.tpl b/view/theme/frio/templates/profile/vcard.tpl index 94f62bd0d..86d6bd917 100644 --- a/view/theme/frio/templates/profile/vcard.tpl +++ b/view/theme/frio/templates/profile/vcard.tpl @@ -72,9 +72,16 @@ {{/if}} {{if $profile.addr}} + {{/if}} + {{if $network_label}} +
+
{{/if}}