]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Support unlisted public posts
[friendica.git] / mod / item.php
index 636bd8c3193496c719488060f29d373f99d48c81..4e14a047f5577f45e6ac2b04a518d04c0c8dd460 100644 (file)
@@ -40,6 +40,7 @@ use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Attach;
+use Friendica\Model\Config\PConfig;
 use Friendica\Model\Contact;
 use Friendica\Model\Conversation;
 use Friendica\Model\FileTag;
@@ -300,7 +301,13 @@ function item_post(App $a) {
 
                $postopts = $_REQUEST['postopts'] ?? '';
 
-               $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
+               if (strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) {
+                       $private = Item::PRIVATE;
+               } elseif (PConfig::get($profile_uid, 'system', 'unlisted')) {
+                       $private == Item::UNLISTED;
+               } else {
+                       $private == Item::PUBLIC;
+               }
 
                // If this is a comment, set the permissions from the parent.
 
@@ -675,7 +682,7 @@ function item_post(App $a) {
                $datarray["item_id"] = -1;
                $datarray["author-network"] = Protocol::DFRN;
 
-               $o = conversation($a, [array_merge($contact_record, $datarray)], new Pager(DI::args()->getQueryString()), 'search', false, true);
+               $o = conversation($a, [array_merge($contact_record, $datarray)], 'search', false, true);
 
                System::jsonExit(['preview' => $o]);
        }