]> git.mxchange.org Git - friendica.git/commitdiff
create third privacy state - public post but not searchable or publicly visible
authorfriendica <info@friendica.com>
Fri, 29 Jun 2012 00:43:29 +0000 (17:43 -0700)
committerfriendica <info@friendica.com>
Fri, 29 Jun 2012 00:43:29 +0000 (17:43 -0700)
include/conversation.php
include/delivery.php
include/items.php
include/notifier.php
include/text.php
mod/events.php
mod/item.php
mod/lockview.php
mod/share.php

index c2113dead4b2a59d813d0a01c1fc36cf2977e70d..f2fb2e97b4c1c7994d9f5a2e16ab094142f9afc9 100644 (file)
@@ -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) {  */
index 8152876683e5eeee31dbdd873bf5aa261912876e..1328771a6789bb3e623459e95e70ec76fd009c50 100644 (file)
@@ -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);
index 7d3ed4fa9d9d7a690650bfae2392b2d2e8e13ea8..494a547341336b395586d494ad6d0da3ba1ff27f 100755 (executable)
@@ -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";
index 443cc30141bceb1e540a75cae9db04aa521a92ed..f54efba31de8101bc5a658e0ece65eec7571651f 100644 (file)
@@ -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;
 
 
index 0b3ebdf854d99941156a88f0c74cf5069c2723fe..3b0050d387a559c93fc391f59c27fc775f5b98e7 100644 (file)
@@ -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;
        }
 }}
index 4a6d3f100e974e5b4ff9bfe73fcf8510bcbb12a3..7940e79a420a6056ea9070010bdd93cc95745790 100755 (executable)
@@ -120,7 +120,7 @@ function events_post(&$a) {
        $datarray['allow_gid'] = $str_group_allow;
        $datarray['deny_cid'] = $str_contact_deny;
        $datarray['deny_gid'] = $str_group_deny;
-       $datarray['private'] = $private_event;
+       $datarray['private'] = (($private_event) ? 1 : 0);
        $datarray['id'] = $event_id;
        $datarray['created'] = $created;
        $datarray['edited'] = $edited;
index aa022d37d8eda0387476e90ebdfe62caca12e8d7..554e97fe46a0d595b2df122a3c32b5c3f4830865 100644 (file)
@@ -228,7 +228,7 @@ function item_post(&$a) {
                                || strlen($parent_item['allow_gid']) 
                                || strlen($parent_item['deny_cid']) 
                                || strlen($parent_item['deny_gid'])) {
-                               $private = 1;
+                               $private = (($parent_item['private']) ? $parent_item['private'] : 1);
                        }
 
                        $str_contact_allow = $parent_item['allow_cid'];
index 9e64e2608b1e341f0e6de41373e643892f8fd85e..a832629f198ef680e0afce32e96a60f1e9de2e06 100644 (file)
@@ -33,7 +33,7 @@ function lockview_content(&$a) {
        $deny_users = expand_acl($item['deny_cid']);
        $deny_groups = expand_acl($item['deny_gid']);
 
-       if(($item['private']) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) 
+       if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) 
                && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
 
                echo t('Remote privacy information not available.') . '<br />';
index 08c63105e35ed04175dce9e1b4c470d1dd838074..29d31f6b51ea547862a719810fc2015f71d700f7 100644 (file)
@@ -15,7 +15,7 @@ function share_init(&$a) {
                intval($post_id),
                intval(local_user())
        );
-       if(! count($r) || ($r[0]['private'] && ($r[0]['network'] != NETWORK_FEED)))
+       if(! count($r) || ($r[0]['private'] == 1))
                killme();
 
        $o = '';