]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Support unlisted public posts
[friendica.git] / mod / item.php
index 2e5a08203621c94c9d90cf7e77506096ab08336d..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.