diff options
author | friendica <info@friendica.com> | 2014-08-08 15:27:17 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-08-08 15:27:17 -0700 |
commit | e9caf9db6ab68effb26f7751aa12d5f5de898001 (patch) | |
tree | 163632ae9886892f26a2951251d21be7d12a9c16 | |
parent | 02b17fd27e12518d299912de56517ff3a88a0544 (diff) | |
download | volse-hubzilla-e9caf9db6ab68effb26f7751aa12d5f5de898001.tar.gz volse-hubzilla-e9caf9db6ab68effb26f7751aa12d5f5de898001.tar.bz2 volse-hubzilla-e9caf9db6ab68effb26f7751aa12d5f5de898001.zip |
a couple of "not quite public" fixes
-rwxr-xr-x | include/items.php | 16 | ||||
-rw-r--r-- | mod/item.php | 22 |
2 files changed, 16 insertions, 22 deletions
diff --git a/include/items.php b/include/items.php index b5c28a453..aa5dd5ea9 100755 --- a/include/items.php +++ b/include/items.php @@ -858,16 +858,15 @@ function encode_item($item) { intval($item['uid']) ); - if($r) { - $public_scope = $r[0]['channel_r_stream']; + if($r) $comment_scope = $r[0]['channel_w_comment']; - } - else { - $public_scope = 0; + else $comment_scope = 0; - } - $scope = map_scope($public_scope); + $scope = $x['public_policy']; + if(! $scope) + $scope = 'public'; + $c_scope = map_scope($comment_scope); if(array_key_exists('item_flags',$item) && ($item['item_flags'] & ITEM_OBSCURED)) { @@ -1846,10 +1845,7 @@ function item_store($arr,$allow_exec = false) { $uplinked_comment = true; } - // if the parent is private, force privacy for the entire conversation - // This differs from the above settings as it subtly allows comments from - // email correspondents to be private even if the overall thread is not. if($r[0]['item_private']) $arr['item_private'] = $r[0]['item_private']; diff --git a/mod/item.php b/mod/item.php index 50bc53d9f..49de263dd 100644 --- a/mod/item.php +++ b/mod/item.php @@ -80,7 +80,6 @@ function item_post(&$a) { $pagetitle = ((x($_REQUEST,'pagetitle')) ? escape_tags($_REQUEST['pagetitle']) : ''); $layout_mid = ((x($_REQUEST,'layout_mid')) ? escape_tags($_REQUEST['layout_mid']): ''); $plink = ((x($_REQUEST,'permalink')) ? escape_tags($_REQUEST['permalink']) : ''); - $public_policy = ((x($_REQUEST,'public_policy')) ? escape_tags($_REQUEST['public_policy']) : ''); /* Check service class limits @@ -258,8 +257,11 @@ function item_post(&$a) { logger('mod_item: post accepted from ' . $observer['xchan_name'] . ' for ' . $owner_xchan['xchan_name'], LOGGER_DEBUG); } - - + $public_policy = ((x($_REQUEST,'public_policy')) ? escape_tags($_REQUEST['public_policy']) : map_scope($channel['channel_r_stream'],true)); + if($webpage) + $public_policy = ''; + if($public_policy) + $private = 1; if($orig_post) { $private = 0; @@ -275,7 +277,7 @@ function item_post(&$a) { $str_contact_allow = $orig_post['allow_cid']; $str_group_deny = $orig_post['deny_gid']; $str_contact_deny = $orig_post['deny_cid']; - $public_policy = $orig_post['public_policy']; + $public_policy = $orig_post['public_policy']; } if((strlen($str_group_allow)) @@ -346,6 +348,7 @@ function item_post(&$a) { || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny) + || strlen($public_policy) ) ? 1 : 0); // If this is a comment, set the permissions from the parent. @@ -357,10 +360,12 @@ function item_post(&$a) { || strlen($parent_item['allow_cid']) || strlen($parent_item['allow_gid']) || strlen($parent_item['deny_cid']) - || strlen($parent_item['deny_gid'])) { + || strlen($parent_item['deny_gid']) + || strlen($parent_item['public_policy'])) { $private = (($parent_item['item_private']) ? $parent_item['item_private'] : 1); } + $public_policy = $parent_item['public_policy']; $str_contact_allow = $parent_item['allow_cid']; $str_group_allow = $parent_item['allow_gid']; $str_contact_deny = $parent_item['deny_cid']; @@ -379,13 +384,6 @@ function item_post(&$a) { } - if((! $webpage) && (! $public_policy) && (! $private)) { - $public_policy = map_scope($channel['channel_r_stream'],true); - if($public_policy) - $private = 1; - } - - $expires = '0000-00-00 00:00:00'; if(feature_enabled($profile_uid,'content_expire')) { |