diff --git a/mod/settings.php b/mod/settings.php index 6fc8c8b1eb..9b505a81e4 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1098,18 +1098,20 @@ function settings_content(App $a) $profile_in_dir = ''; } else { $profile_in_dir = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['profile_in_directory', DI::l10n()->t('Publish your default profile in your local site directory?'), $profile['publish'], DI::l10n()->t('Your profile will be published in this node\'s local directory. Your profile details may be publicly visible depending on the system settings.', DI::baseUrl().'/directory')] + '$field' => ['profile_in_directory', DI::l10n()->t('Publish your profile in your local site directory?'), $profile['publish'], DI::l10n()->t('Your profile will be published in this node\'s local directory. Your profile details may be publicly visible depending on the system settings.', DI::baseUrl().'/directory')] ]); } if (strlen(DI::config()->get('system', 'directory'))) { - $profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['profile_in_netdirectory', DI::l10n()->t('Publish your default profile in the global social directory?'), $profile['net-publish'], DI::l10n()->t('Your profile will be published in the global friendica directories (e.g. %s). Your profile will be visible in public.', DI::config()->get('system', 'directory'), DI::config()->get('system', 'directory')) . " " . DI::l10n()->t("This setting also determines whether Friendica will inform search engines that your profile should be indexed or not. Third-party search engines may or may not respect this setting.")] - ]); + $net_pub_desc = ' ' . DI::l10n()->t('Your profile will also be published in the global friendica directories (e.g. %s).', DI::config()->get('system', 'directory'), DI::config()->get('system', 'directory')); } else { - $profile_in_net_dir = ''; + $net_pub_desc = ''; } + $profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [ + '$field' => ['profile_in_netdirectory', DI::l10n()->t('Allow your profile to be searchable globally?'), $profile['net-publish'], DI::l10n()->t("Activate this setting if you want others to easily find and follow you. Your profile will be searchable on remote systems. This setting also determines whether Friendica will inform search engines that your profile should be indexed or not.") . $net_pub_desc] + ]); + $hide_friends = Renderer::replaceMacros($opt_tpl, [ '$field' => ['hide-friends', DI::l10n()->t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], DI::l10n()->t('Your contact list won\'t be shown in your default profile page. You can decide to show your contact list separately for each additional profile you create')], ]); @@ -1134,10 +1136,6 @@ function settings_content(App $a) '$field' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')], ]); - if (!$profile['publish'] && !$profile['net-publish']) { - info(DI::l10n()->t('Profile is not published.') . EOL); - } - $tpl_addr = Renderer::getMarkupTemplate('settings/nick_set.tpl'); $prof_addr = Renderer::replaceMacros($tpl_addr,[ diff --git a/src/Model/Contact.php b/src/Model/Contact.php index df97bb17b1..5eb4ed036f 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -785,7 +785,7 @@ class Contact $fields['avatar'] = DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix; $fields['forum'] = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY; $fields['prv'] = $user['page-flags'] == User::PAGE_FLAGS_PRVGROUP; - $fields['unsearchable'] = $user['hidewall'] || !$profile['net-publish']; + $fields['unsearchable'] = !$profile['net-publish']; // it seems as if ported accounts can have wrong values, so we make sure that now everything is fine. $fields['url'] = DI::baseUrl() . '/profile/' . $user['nickname']; diff --git a/src/Model/GContact.php b/src/Model/GContact.php index 6dbd393f52..95afc1be6e 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -1136,7 +1136,7 @@ class GContact 'keywords' => $userdata['pub_keywords'], 'birthday' => $userdata['dob'], 'photo' => $userdata['photo'], "notify" => $userdata['notify'], 'url' => $userdata['url'], - "hide" => ($userdata['hidewall'] || !$userdata['net-publish']), + "hide" => !$userdata['net-publish'], 'nick' => $userdata['nickname'], 'addr' => $userdata['addr'], "connect" => $userdata['addr'], "server_url" => DI::baseUrl(), "generation" => 1, 'network' => Protocol::DFRN]; diff --git a/src/Model/Profile.php b/src/Model/Profile.php index d91d56488e..c081384520 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -392,7 +392,7 @@ class Profile $diaspora = [ 'guid' => $profile['guid'], 'podloc' => DI::baseUrl(), - 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false'), + 'searchable' => ($profile['net-publish'] ? 'true' : 'false'), 'nickname' => $profile['nickname'], 'fullname' => $profile['name'], 'firstname' => $firstname, diff --git a/src/Model/User.php b/src/Model/User.php index d8e47450f6..e4ef07e473 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -616,8 +616,7 @@ class User $verified = !empty($data['verified']); $language = !empty($data['language']) ? Strings::escapeTags(trim($data['language'])) : 'en'; - $publish = !empty($data['profile_publish_reg']); - $netpublish = $publish && DI::config()->get('system', 'directory'); + $netpublish = $publish = !empty($data['profile_publish_reg']); if ($password1 != $confirm) { throw new Exception(DI::l10n()->t('Passwords do not match. Password unchanged.')); diff --git a/src/Module/HoverCard.php b/src/Module/HoverCard.php index e5882046be..f3b8248a6b 100644 --- a/src/Module/HoverCard.php +++ b/src/Module/HoverCard.php @@ -75,7 +75,7 @@ class HoverCard extends BaseModule $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : '')); - $page['htmlhead'] .= '' . "\r\n"; + $page['htmlhead'] .= '' . "\r\n"; $page['htmlhead'] .= '' . "\r\n"; $page['htmlhead'] .= '' . "\r\n"; header('Link: <' . $baseUrl->get() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 8bc9e6a51a..a03770d0d4 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -69,7 +69,7 @@ class NoScrape extends BaseModule $json_info["dfrn-{$dfrn}"] = DI::baseUrl() . "/dfrn_{$dfrn}/{$which}"; } - if (!$a->profile['net-publish'] || $a->profile['hidewall']) { + if (!$a->profile['net-publish']) { $json_info['hide'] = true; System::jsonExit($json_info); } diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php index 896eb0c27e..bbf0da3821 100644 --- a/src/Module/Profile/Profile.php +++ b/src/Module/Profile/Profile.php @@ -293,7 +293,7 @@ class Profile extends BaseProfile $htmlhead .= '' . "\n"; - if (!$profile['net-publish'] || $profile['hidewall']) { + if (!$profile['net-publish']) { $htmlhead .= '' . "\n"; } diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 4cd14c021a..c3c5e461f4 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -48,7 +48,7 @@ class Status extends BaseProfile ProfileModel::load($a, $parameters['nickname']); - if (!$a->profile['net-publish'] || $a->profile['hidewall']) { + if (!$a->profile['net-publish']) { DI::page()['htmlhead'] .= '' . "\n"; } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index ff891701a3..f065cd67ec 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -639,27 +639,17 @@ class DFRN */ private static function addAuthor(DOMDocument $doc, array $owner, $authorelement, $public) { - // Is the profile hidden or shouldn't be published in the net? Then add the "hide" element - $r = q( - "SELECT `id` FROM `profile` INNER JOIN `user` ON `user`.`uid` = `profile`.`uid` - WHERE (`hidewall` OR NOT `net-publish`) AND `user`.`uid` = %d", - intval($owner['uid']) - ); - if (DBA::isResult($r)) { - $hidewall = true; - } else { - $hidewall = false; - } + // Should the profile be "unsearchable" in the net? Then add the "hide" element + $hide = DBA::exists('profile', ['uid' => $owner['uid'], 'net-publish' => false]); $author = $doc->createElement($authorelement); $namdate = DateTimeFormat::utc($owner['name-date'].'+00:00', DateTimeFormat::ATOM); - $uridate = DateTimeFormat::utc($owner['uri-date'].'+00:00', DateTimeFormat::ATOM); $picdate = DateTimeFormat::utc($owner['avatar-date'].'+00:00', DateTimeFormat::ATOM); $attributes = []; - if (!$public || !$hidewall) { + if (!$public || !$hide) { $attributes = ["dfrn:updated" => $namdate]; } @@ -670,7 +660,7 @@ class DFRN $attributes = ["rel" => "photo", "type" => "image/jpeg", "media:width" => 300, "media:height" => 300, "href" => $owner['photo']]; - if (!$public || !$hidewall) { + if (!$public || !$hide) { $attributes["dfrn:updated"] = $picdate; } @@ -679,7 +669,7 @@ class DFRN $attributes["rel"] = "avatar"; XML::addElement($doc, $author, "link", "", $attributes); - if ($hidewall) { + if ($hide) { XML::addElement($doc, $author, "dfrn:hide", "true"); } diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 8765c2156e..fd20991108 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -4118,7 +4118,7 @@ class Diaspora $large = DI::baseUrl().'/photo/custom/300/'.$profile['uid'].'.jpg'; $medium = DI::baseUrl().'/photo/custom/100/'.$profile['uid'].'.jpg'; $small = DI::baseUrl().'/photo/custom/50/' .$profile['uid'].'.jpg'; - $searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false'); + $searchable = ($profile['net-publish'] ? 'true' : 'false'); $dob = null; $about = null;