From 9dfe39b83dd181590fe9ff59c11b69710d2f8d73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jakobus=20Sch=C3=BCrz=20=28admin=29?= Date: Sun, 1 Oct 2023 14:03:03 +0200 Subject: [PATCH] set label in hovercard for mentionings --- src/Content/Item.php | 2 ++ src/Model/Contact.php | 4 ++++ view/templates/hovercard.tpl | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index c94ec1299b..9e50602df6 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -432,6 +432,8 @@ class Item $this->l10n->t('Network Posts') => $posts_link, $this->l10n->t('View Contact') => $contact_url, $this->l10n->t('Send PM') => $pm_url, + $this->l10n->t('Mention') => $mention_url, + $this->l10n->t('Post to group') => $mention_url, $this->l10n->t('Block') => $block_link, $this->l10n->t('Ignore') => $ignore_link, $this->l10n->t('Collapse') => $collapse_link, diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 243b48ad1d..a8ee936861 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1177,6 +1177,7 @@ class Contact } $pm_url = ''; + $mention_url = ''; $status_link = ''; $photos_link = ''; @@ -1197,6 +1198,7 @@ class Contact $pm_url = 'message/new/' . $contact['id']; } + $mention_url = 'compose/0?body=@' . $contact['addr']; $contact_url = 'contact/' . $contact['id']; $posts_link = 'contact/' . $contact['id'] . '/conversations'; @@ -1230,8 +1232,10 @@ class Contact 'network' => [DI::l10n()->t('Network Posts'), $posts_link, false], 'edit' => [DI::l10n()->t('View Contact'), $contact_url, false], 'pm' => [DI::l10n()->t('Send PM'), $pm_url, false], + 'mention' => [DI::l10n()->t('Mention'), DI::l10n()->t('Post to group'), $mention_url, false], 'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true], 'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true], + 'isgroup' => [$contact['forum'], true], ]; if (!empty($contact['pending'])) { diff --git a/view/templates/hovercard.tpl b/view/templates/hovercard.tpl index ff3b3101a3..0162b8327e 100644 --- a/view/templates/hovercard.tpl +++ b/view/templates/hovercard.tpl @@ -22,9 +22,9 @@ {{* @todo we have two different photo menus one for contacts and one for items at the network stream. We currently use the contact photo menu, so the items options are missing We need to move them *}}
{{if $profile.actions.pm}}{{$profile.actions.pm.0}}{{/if}} + {{if $profile.addr}}{{/if}}
- {{if $profile.addr}}{{/if}} {{if $profile.actions.network}}{{/if}} {{if $profile.actions.edit}}{{/if}} {{if $profile.actions.follow}}{{/if}} -- 2.39.5