Don't display the "follow/unfollow" vcard-link on pages meant for follow/unfollow
* @template widget/vcard.tpl
* @param array $contact
* @param bool $hide_mention
+ * @param bool $hide_follow
* @return string
*/
- public static function getHTML(array $contact, bool $hide_mention = false): string
+ public static function getHTML(array $contact, bool $hide_mention = false, bool $hide_follow = false): string
{
if (!isset($contact['network']) || !isset($contact['id'])) {
Logger::warning('Incomplete contact', ['contact' => $contact ?? []]);
}
}
- if (empty($contact['self']) && Protocol::supportsFollow($contact['network'])) {
+ if (!$hide_follow && empty($contact['self']) && Protocol::supportsFollow($contact['network'])) {
if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) {
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact_url) . '&auto=1';
} elseif (!$pending) {
$this->page['aside'] = '';
if (!in_array($protocol, [Protocol::PHANTOM, Protocol::MAIL])) {
- $this->page['aside'] = VCard::getHTML($contact);
+ $this->page['aside'] = VCard::getHTML($contact, false, true);
$output .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'),
['$title' => $this->t('Posts and Replies')]
'$keywords_label' => ''
]);
- $this->page['aside'] = Widget\VCard::getHTML(Contact::getByURL($contact['url'], false));
+ $this->page['aside'] = Widget\VCard::getHTML(Contact::getByURL($contact['url'], false), false, true);
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => $this->t('Posts and Replies')]);
protected function content(array $request = []): string
{
- $this->page['aside'] = Widget\VCard::getHTML($this->owner);
+ $this->page['aside'] = Widget\VCard::getHTML($this->owner, false, true);
$target_addr = $this->owner['addr'];
$target_url = $this->owner['url'];