]> git.mxchange.org Git - friendica.git/commitdiff
set variables for correct mentioning
authorJakobus Schürz (admin) <adminjs@schuerz.at>
Sun, 1 Oct 2023 20:37:34 +0000 (22:37 +0200)
committerJakobus Schürz (admin) <adminjs@schuerz.at>
Sun, 1 Oct 2023 20:37:34 +0000 (22:37 +0200)
src/Model/Contact.php

index 0f426529fb2e6d66ca62adbc1355a8bc33feaf31..02132c0f1d9a394d4614417e7f85b640b964ecb0 100644 (file)
@@ -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'])) {