X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=ceef63a9927d83da75d1b675bfc27150fcfc7d7a;hb=1478229abc6c5adc265559b5489cc2eb23358994;hp=90efc6d247f6dda0b2822d58bfd60316d12d5f38;hpb=79012bf8882baa6843726bcffbcafe959028c1bd;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 90efc6d247..ceef63a992 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -394,12 +394,34 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $thumb = $item['thumb']; $indent = ''; $osparkle = ''; + $visiting = false; $lastcollapsed = false; $firstcollapsed = false; $total_children += count_descendants($item); $toplevelpost = (($item['id'] == $item['parent']) ? true : false); + + + if($item['uid'] == local_user()) + $dropping = true; + elseif(is_array($_SESSION['remote'])) { + foreach($_SESSION['remote'] as $visitor) { + if($visitor['cid'] == $item['contact-id']) { + $dropping = true; + $visiting = true; + break; + } + } + } + $item_writeable = (($item['writable'] || $item['self']) ? true : false); + + // This will allow us to comment on wall-to-wall items owned by our friends + // and community forums even if somebody else wrote the post. + + if($visiting && $mode == 'profile') + $item_writeable = true; + $show_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false); $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) @@ -411,8 +433,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit")); else $edpost = false; - if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) - $dropping = true; $drop = array( 'dropping' => $dropping,