]> git.mxchange.org Git - friendica.git/commitdiff
enhanced email privacy
authorFriendika <info@friendika.com>
Thu, 11 Aug 2011 08:52:31 +0000 (01:52 -0700)
committerFriendika <info@friendika.com>
Thu, 11 Aug 2011 08:52:31 +0000 (01:52 -0700)
include/conversation.php
include/poller.php

index 6b1f6492508aa9d9360ddae056da378cb106dc1a..0d901a3c06d6204eb076bf926d9cd585253393e1 100644 (file)
@@ -283,14 +283,14 @@ function conversation(&$a, $items, $mode, $update) {
                                continue;
 
                        $toplevelpost = (($item['id'] == $item['parent']) ? true : false);
-
+                       $toplevelprivate = false;
 
                        // Take care of author collapsing and comment collapsing
                        // If a single author has more than 3 consecutive top-level posts, squash the remaining ones.
                        // 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);
 
                                if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
@@ -312,9 +312,12 @@ function conversation(&$a, $items, $mode, $update) {
                                $comments_seen = 0;
                                $comments_collapsed = false;
                        }
-                       else
+                       else {
+                               // prevent private email from leaking into public conversation
+                               if((! $toplevelpost) && (! toplevelprivate) && ($item['private']) && ($profile_owner != local_user()))
+                                       continue;
                                $comments_seen ++;
-
+                       }       
 
                        $override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
                        $show_comment_box = ((($page_writeable) && ($item_writeable) && ($comments_seen == $comments[$item['parent']])) ? true : false);
index 6ac99fc7d0cf5304721a2ba449769499970202aa..86bb8ad55b0b52bdb8fbb17466cb041125242c00 100644 (file)
@@ -421,8 +421,10 @@ function poller_run($argv, $argc){
                                                        $datarray['contact-id'] = $contact['id'];
                                                        if($datarray['parent-uri'] === $datarray['uri'])
                                                                $datarray['private'] = 1;
-                                                       if(! get_pconfig($importer_uid,'system','allow_public_email_replies'))
+                                                       if(! get_pconfig($importer_uid,'system','allow_public_email_replies')) {
                                                                $datarray['private'] = 1;
+                                                               $datarray['allow_cid'] = '<' . $contact['id'] . '>';
+                                                       }
                                                        $datarray['author-name'] = $contact['name'];
                                                        $datarray['author-link'] = 'mailbox';
                                                        $datarray['author-avatar'] = $contact['photo'];