From 35de254bd25d5ee0f8d247c2d9d683d4a217d6e8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 5 Nov 2023 08:48:08 -0500 Subject: [PATCH 1/2] [frio] Fix indentation and wrong button tag usage in vcard templates --- view/theme/frio/templates/profile/vcard.tpl | 26 +++++++++++---------- view/theme/frio/templates/widget/vcard.tpl | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/view/theme/frio/templates/profile/vcard.tpl b/view/theme/frio/templates/profile/vcard.tpl index 86d6bd917..b41b206ee 100644 --- a/view/theme/frio/templates/profile/vcard.tpl +++ b/view/theme/frio/templates/profile/vcard.tpl @@ -70,19 +70,21 @@ {{/if}} - {{if $profile.addr}} - + {{if $profile.addr}} + {{/if}} - {{if $network_label}} -
-
+ {{if $network_label}} +
+ + + {{$network_label}} + +
{{/if}} {{/if}} diff --git a/view/theme/frio/templates/widget/vcard.tpl b/view/theme/frio/templates/widget/vcard.tpl index 9f030a8ef..fff5a4b0e 100644 --- a/view/theme/frio/templates/widget/vcard.tpl +++ b/view/theme/frio/templates/widget/vcard.tpl @@ -66,10 +66,10 @@ {{/if}} {{if $showgroup_link}}
- +
{{/if}} From da9baf2be8908abbedef62c533e1894aae8f074b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 5 Nov 2023 08:49:12 -0500 Subject: [PATCH 2/2] Use public contact ID in Model\Profile::getVCardHtml instead of potentially self-contact ID - This prevented contact conversation link from working --- src/Model/Profile.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 373acbc17..a6386c281 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -307,7 +307,12 @@ class Profile $profile_url = $profile['url']; - $cid = $profile['id']; + $contact = Contact::selectFirst(['id'], ['uri-id' => $profile['uri-id'], 'uid' => 0]); + if (!$contact) { + return $o; + } + + $cid = $contact['id']; $follow_link = null; $unfollow_link = null; @@ -457,12 +462,12 @@ class Profile $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']; + $network_url = 'network/group/' . $cid; } 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'; + $network_url = 'contact/' . $cid . '/conversations'; } $tpl = Renderer::getMarkupTemplate('profile/vcard.tpl');