diff options
author | friendica <info@friendica.com> | 2012-06-28 17:43:29 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-06-28 17:43:29 -0700 |
commit | a3edbf7e5d0d89e99c2249cf30657b1fbc57982a (patch) | |
tree | 75d20b8a787b229c0fdbb48861b4a064e35c31fb /include | |
parent | 43d3721fa92f21007f45427eea35810a3b8545c6 (diff) | |
download | volse-hubzilla-a3edbf7e5d0d89e99c2249cf30657b1fbc57982a.tar.gz volse-hubzilla-a3edbf7e5d0d89e99c2249cf30657b1fbc57982a.tar.bz2 volse-hubzilla-a3edbf7e5d0d89e99c2249cf30657b1fbc57982a.zip |
create third privacy state - public post but not searchable or publicly visible
Diffstat (limited to 'include')
-rw-r--r-- | include/conversation.php | 12 | ||||
-rw-r--r-- | include/delivery.php | 4 | ||||
-rwxr-xr-x | include/items.php | 10 | ||||
-rw-r--r-- | include/notifier.php | 2 | ||||
-rw-r--r-- | include/text.php | 5 |
5 files changed, 17 insertions, 16 deletions
diff --git a/include/conversation.php b/include/conversation.php index c2113dead..f2fb2e97b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -427,12 +427,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // We've already parsed out like/dislike for special treatment. We can ignore them now if(((activity_match($item['verb'],ACTIVITY_LIKE)) - || (activity_match($item['verb'],ACTIVITY_DISLIKE)))) -// && ($item['id'] != $item['parent'])) + || (activity_match($item['verb'],ACTIVITY_DISLIKE))) + && ($item['id'] != $item['parent'])) continue; $toplevelpost = (($item['id'] == $item['parent']) ? true : false); - $toplevelprivate = false; + // Take care of author collapsing and comment collapsing // (author collapsing is currently disabled) @@ -440,7 +440,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // If there are more than two comments, squash all but the last 2. if($toplevelpost) { - $toplevelprivate = (($toplevelpost && $item['private']) ? true : false); + $item_writeable = (($item['writable'] || $item['self']) ? true : false); $comments_seen = 0; @@ -485,7 +485,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ; - $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); @@ -546,7 +546,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $likebuttons = ''; - $shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false); + $shareable = ((($profile_owner == local_user()) && (! $item['private'] == 1)) ? true : false); if($page_writeable) { /* if($toplevelpost) { */ diff --git a/include/delivery.php b/include/delivery.php index 815287668..1328771a6 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -280,7 +280,7 @@ function delivery_run($argv, $argc){ continue; // private emails may be in included in public conversations. Filter them. - if(($public_message) && $item['private']) + if(($public_message) && $item['private'] == 1) continue; $item_contact = get_item_contact($item,$icontacts); @@ -383,7 +383,7 @@ function delivery_run($argv, $argc){ continue; // private emails may be in included in public conversations. Filter them. - if(($public_message) && $item['private']) + if(($public_message) && $item['private'] == 1) continue; $item_contact = get_item_contact($item,$icontacts); diff --git a/include/items.php b/include/items.php index 7d3ed4fa9..494a54734 100755 --- a/include/items.php +++ b/include/items.php @@ -466,8 +466,8 @@ function get_atom_elements($feed,$item) { $res['last-child'] = 0; $private = $item->get_item_tags(NAMESPACE_DFRN,'private'); - if($private && $private[0]['data'] == 1) - $res['private'] = 1; + if($private && intval($private[0]['data']) > 0) + $res['private'] = intval($private[0]['data']); else $res['private'] = 0; @@ -814,7 +814,7 @@ function item_store($arr,$force_parent = false) { // email correspondents to be private even if the overall thread is not. if($r[0]['private']) - $arr['private'] = 1; + $arr['private'] = $r[0]['private']; // Edge case. We host a public forum that was originally posted to privately. // The original author commented, but as this is a comment, the permissions @@ -1890,7 +1890,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $datarray['last-child'] = 0; } if($contact['network'] === NETWORK_FEED) - $datarray['private'] = 1; + $datarray['private'] = 2; // This is my contact on another system, but it's really me. // Turn this into a wall post. @@ -3035,7 +3035,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { $o .= '<georss:point>' . xmlify($item['coord']) . '</georss:point>' . "\r\n"; if(($item['private']) || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) - $o .= '<dfrn:private>1</dfrn:private>' . "\r\n"; + $o .= '<dfrn:private>' . (($item['private']) ? $item['private'] : 1) . '</dfrn:private>' . "\r\n"; if($item['extid']) $o .= '<dfrn:extid>' . xmlify($item['extid']) . '</dfrn:extid>' . "\r\n"; diff --git a/include/notifier.php b/include/notifier.php index 443cc3014..f54efba31 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -399,7 +399,7 @@ function notifier_run($argv, $argc){ // private emails may be in included in public conversations. Filter them. - if(($public_message) && $item['private']) + if(($public_message) && $item['private'] == 1) continue; diff --git a/include/text.php b/include/text.php index 0b3ebdf85..3b0050d38 100644 --- a/include/text.php +++ b/include/text.php @@ -1059,12 +1059,13 @@ function feed_salmonlinks($nick) { if(! function_exists('get_plink')) { function get_plink($item) { $a = get_app(); - if (x($item,'plink') && ((! $item['private']) || ($item['network'] === NETWORK_FEED))){ + if (x($item,'plink') && ($item['private'] != 1)) { return array( 'href' => $item['plink'], 'title' => t('link to source'), ); - } else { + } + else { return false; } }} |