]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Merge branch 'master' of github.com:annando/friendica
[friendica.git] / include / conversation.php
index e5549a9c101ecfc810962dd4b19dc18bb6e67c0e..dc574ddff8e899a0caa0f494d1e46dff0324565c 100644 (file)
@@ -174,6 +174,7 @@ function localize_item(&$item){
                }
        }
 
+
 }
 
 /**
@@ -278,6 +279,9 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                else
                                        $nickname = $a->user['nickname'];
                                
+                               // prevent private email from leaking.
+                               if($item['network'] === NETWORK_MAIL && local_user() != $item['uid'])
+                                               continue;
                        
                                $profile_name   = ((strlen($item['author-name']))   ? $item['author-name']   : $item['name']);
                                if($item['author-link'] && (! $item['author-name']))
@@ -342,7 +346,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                        'body' => template_escape($body),
                                        'text' => strip_tags(template_escape($body)),
                                        'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
-                                       'lock' => $lock,
                                        'location' => template_escape($location),
                                        'indent' => '',
                                        'owner_name' => template_escape($owner_name),
@@ -400,6 +403,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                        }
 
                        $comments_collapsed = false;
+                       $comments_seen = 0;
                        $comment_lastcollapsed = false;
                        $comment_firstcollapsed = false;
                        $blowhard = 0;
@@ -447,8 +451,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                else {
 
                                        // prevent private email reply to public conversation from leaking.
-                                       if($item['private'] && ! $threads[$threadsid]['private'])
-                                               continue;
+                                       if($item['network'] === NETWORK_MAIL && local_user() != $item['uid'])
+                                                       continue;
 
                                        $comments_seen ++;
                                        $comment_lastcollapsed  = false;
@@ -553,6 +557,14 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                                        '$myphoto' => $a->contact['thumb'],
                                                        '$comment' => t('Comment'),
                                                        '$submit' => t('Submit'),
+                                                       '$edbold' => t('Bold'),
+                                                       '$editalic' => t('Italic'),
+                                                       '$eduline' => t('Underline'),
+                                                       '$edquote' => t('Quote'),
+                                                       '$edcode' => t('Code'),
+                                                       '$edimg' => t('Image'),
+                                                       '$edurl' => t('Link'),
+                                                       '$edvideo' => t('Video'),
                                                        '$preview' => t('Preview'),
                                                        '$ww' => (($mode === 'network') ? $commentww : '')
                                                ));
@@ -709,7 +721,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
        }
 
        $page_template = get_markup_template("conversation.tpl");
-       $o .= replace_macros($page_template, array(
+       $o = replace_macros($page_template, array(
                '$baseurl' => $a->get_baseurl($ssl_state),
                '$mode' => $mode,
                '$user' => $a->user,
@@ -951,7 +963,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
        $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));        
 
        $o .= replace_macros($tpl,array(
-               '$return_path' => $a->cmd,
+               '$return_path' => $a->query_string,
                '$action' =>  $a->get_baseurl(true) . '/item',
                '$share' => (x($x,'button') ? $x['button'] : t('Share')),
                '$upload' => t('Upload photo'),
@@ -1074,7 +1086,6 @@ function find_thread_parent_index($arr,$x) {
 }
 
 function render_location_google($item) {
-       $location = '';
        $location = (($item['location']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
        $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
        if($coord) {