mirror of
https://github.com/friendica/friendica
synced 2025-04-25 21:50:12 +00:00
Clarify the effect of "net-publish"
This commit is contained in:
parent
9182879a00
commit
ee6cceba30
11 changed files with 21 additions and 34 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue