X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact.php;h=47b8ad4cfdd5a8ecefdc00c0e72c5d1db12c7476;hb=9cbad559a1bda6f9ff87b094d01c7511f663a893;hp=a8ee936861ae2b87f11c315d582a056a42ccbc7d;hpb=9dfe39b83dd181590fe9ff59c11b69710d2f8d73;p=friendica.git diff --git a/src/Model/Contact.php b/src/Model/Contact.php index a8ee936861..47b8ad4cfd 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1198,9 +1198,23 @@ class Contact $pm_url = 'message/new/' . $contact['id']; } - $mention_url = 'compose/0?body=@' . $contact['addr']; + if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { + $mention_label = DI::l10n()->t('Post to group'); + $mention_url = 'compose/0?body=!' . $contact['addr']; + } else { + $mention_label = DI::l10n()->t('Mention'); + $mention_url = 'compose/0?body=@' . $contact['addr']; + } + $contact_url = 'contact/' . $contact['id']; - $posts_link = 'contact/' . $contact['id'] . '/conversations'; + + if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { + $network_label = DI::l10n()->t('View group'); + $network_url = 'network/group/' . $contact['id']; + } else { + $network_label = DI::l10n()->t('Network Posts'); + $network_url = 'contact/' . $contact['id'] . '/conversations'; + } $follow_link = ''; $unfollow_link = ''; @@ -1216,26 +1230,30 @@ class Contact * Menu array: * "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ] */ + + if (empty($contact['uid'])) { $menu = [ 'profile' => [DI::l10n()->t('View Profile'), $profile_link, true], - 'network' => [DI::l10n()->t('Network Posts'), $posts_link, false], + 'network' => [$network_label, $network_url, false], '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], + 'self' => [$contact['self'] ?? false, true], ]; } else { $menu = [ 'status' => [DI::l10n()->t('View Status'), $status_link, true], 'profile' => [DI::l10n()->t('View Profile'), $profile_link, true], 'photos' => [DI::l10n()->t('View Photos'), $photos_link, true], - 'network' => [DI::l10n()->t('Network Posts'), $posts_link, false], + 'network' => [$network_label, $network_url, 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], + 'mention' => [$mention_label, $mention_url, false], ]; if (!empty($contact['pending'])) {