Clarify the effect of "net-publish"

This commit is contained in:
Michael
2020-02-16 15:39:44 +00:00
parent 9182879a00
commit ee6cceba30
11 changed files with 21 additions and 34 deletions
+1 -1
View File
@@ -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'];
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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,
+1 -2
View File
@@ -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.'));
+1 -1
View File
@@ -75,7 +75,7 @@ class HoverCard extends BaseModule
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : ''));
$page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n";
$page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . ($a->profile['net-publish'] ? 'true' : 'false') . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl->get() . '/dfrn_poll/' . $nickname . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $baseUrl->get() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . $baseUrl->get() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -293,7 +293,7 @@ class Profile extends BaseProfile
$htmlhead .= '<meta name="dfrn-global-visibility" content="' . ($profile['net-publish'] ? 'true' : 'false') . '" />' . "\n";
if (!$profile['net-publish'] || $profile['hidewall']) {
if (!$profile['net-publish']) {
$htmlhead .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}
+1 -1
View File
@@ -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'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}
+5 -15
View File
@@ -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");
}
+1 -1
View File
@@ -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;