]> git.mxchange.org Git - friendica.git/commitdiff
Improved description, support for "unlisted" via DFRN as well.
authorMichael <heluecht@pirati.ca>
Mon, 2 Mar 2020 22:35:25 +0000 (22:35 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 2 Mar 2020 22:35:25 +0000 (22:35 +0000)
mod/settings.php
src/Protocol/DFRN.php

index dd3303892bbe9de1c436c99384eb3c2bc665a148..47505bd7263e67595da14f58d64402013cde4535 100644 (file)
@@ -840,7 +840,7 @@ function settings_content(App $a)
        ]);
 
        $unlisted = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['unlisted', DI::l10n()->t('Should public posts be unlisted?'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community page or in search results, nor will they be transported to relay servers.')],
+               '$field' => ['unlisted', DI::l10n()->t('Should public posts be unlisted?'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community page or in search results, nor will they be transported to relay servers. However they can appear on public feeds from other servers.')],
        ]);
 
        $blockwall = Renderer::replaceMacros($opt_tpl, [
index 078deff7a3876ab348c3a72d049a36805a94acad..4c88db1d944a47c0a70d69e7618566438fb652f9 100644 (file)
@@ -1052,6 +1052,7 @@ class DFRN
                if ($item['private']) {
                        // Friendica versions prior to 2020.3 can't handle "unlisted" properly. So we can only transmit public and private
                        XML::addElement($doc, $entry, "dfrn:private", ($item['private'] == Item::PRIVATE ? Item::PRIVATE : Item::PUBLIC));
+                       XML::addElement($doc, $entry, "dfrn:unlisted", $item['private'] == Item::UNLISTED);
                }
 
                if ($item['extid']) {
@@ -2405,6 +2406,11 @@ class DFRN
 
                $item["private"] = XML::getFirstNodeValue($xpath, "dfrn:private/text()", $entry);
 
+               $unlisted = XML::getFirstNodeValue($xpath, "dfrn:unlisted/text()", $entry);
+               if (!empty($unlisted) && ($item['private'] != Item::PRIVATE)) {
+                       $item['private'] = Item::UNLISTED;
+               }
+
                $item["extid"] = XML::getFirstNodeValue($xpath, "dfrn:extid/text()", $entry);
 
                if (XML::getFirstNodeValue($xpath, "dfrn:bookmark/text()", $entry) == "true") {