From 4b161b0d65780df716fe9d2202a2b600f1e5147f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jakobus=20Sch=C3=BCrz=20=28admin=29?= Date: Sun, 1 Oct 2023 22:37:34 +0200 Subject: [PATCH] set variables for correct mentioning --- src/Model/Contact.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 0f426529fb..02132c0f1d 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1180,6 +1180,7 @@ class Contact $mention_url = ''; $status_link = ''; $photos_link = ''; + $self = false; if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) { $profile_link = 'contact/redir/' . $contact['id']; @@ -1203,6 +1204,12 @@ class Contact } else { $mention_url = 'compose/0?body=@' . $contact['addr']; } + + + if (in_array($contact['rel'], [contact::SHARING])) { + $self = true; + } + $contact_url = 'contact/' . $contact['id']; $posts_link = 'contact/' . $contact['id'] . '/conversations'; $group_link = 'network/group/' . $contact['id']; @@ -1228,6 +1235,8 @@ class Contact 'edit' => [DI::l10n()->t('View Contact'), $contact_url, false], 'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true], 'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true], + 'mention' => [DI::l10n()->t('Mention'), DI::l10n()->t('Post to group'), $mention_url, false], + 'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true], ]; } else { $menu = [ @@ -1241,6 +1250,7 @@ class Contact 'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true], 'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true], 'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true], + 'self' => [$self], ]; if (!empty($contact['pending'])) { -- 2.39.5